开发者

question regarding twitter search api

I want to use the twitter search api to search for some famous person. For instance I want to search for a particular "Mr Patrick Lee C K". I would construct my search term to be something like:

http://search.twitter.com/search?q=%22lee+c+k%22+OR+%22patrick+lee%22

However, knowing that tweets are often informal, I know that sometimes people can address him by his initials 'lck'. To increase the precision of my search, I figure it would be better if my query can associate with his company, for instance my query could also be lck microsoft.

Now, i want to string these 3 search terms "patrick lee"/"lee c k"/lck microsoft together in one q开发者_StackOverflow社区uery. I probably will use OR. Then again, my last search term should not be a fixed phrase i.e word lck and microsoft can be some distance from each other.

Can anyone tell me how should i link these search terms together inside one query?


Stringing your queries together with "OR" is the best way to do this. The best way to do this is by searching "patrick lee" OR "lee c k" OR lck microsoft. Note that proximity queries are not supported by the Twitter Search API.

There's a few reasons why: 1) The search query only counts towards one count of your API limit, despite it being a fairly expensive query and 2) even though you can't really do a proximity query for "lck microsoft", Tweets are only 140 characters and chances are that those terms would be fairly close to each other regardless. In fact, eliminating the quotes around "lee c k" might actually raise your recall without compromising too much precision.

The features available on the Twitter Advanced Search page are the full list of features that you can use in your search query.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜