Hi there,
For use in the API I don't really suggest using the separate URL parameters like the advanced search pages does. The best bet is to put it all in the q= parameter using the operator syntax. Check out http://search.twitter.com/operators for some examples, and I have included some below:
On Apr 21, 2009, at 10:23 AM, Jeffrey Greenberg wrote:
I'm not clear on what is possible with search. I've played with the advanced search page, and with the api directly, but I could still use some explanation... There are the usual "and" "or" "not" operators but it does not appear to me that these can be combined in anything but the most simple ways. Is that right? There seems to be a lack of a 'grouping' operator to combine these expressions. Instead, the api seems to list these operators together so that they can all be present at once... If so, then how are the operators taken together when they are all supplied?
There is no grouping but it has been requested (http://code.google.com/p/twitter-api/issues/detail?id=321 ). You can still use OR and - (not) with other queries. Things like this work:
[hot OR sunny -bono] (square brackets added to delimit the query, OR must be capital).
That would fine entries with "hot" or "sunny" but without "bono".
How are "quoted strings" handled with these? I'm not clear....
[foo bar] finds and tweet that contains both "foo" and "bar" anywhere in the tweet. ["foo bar"] finds only those tweets where "foo" and "bar" are next to each other (only a space or punctuation in between).
Then there is "phrase" which implies a word ordering, but how can a phrase be combined with the above operators? And does a "quoted string" differ from a phrase? And what if a quoted string is suppled in the "word" field, and something else in the "phrase" field
Quoted string and phrase are really just two words for the same thing. Sorry for the confusion.
The operators such as "tude" and "tags" are also confusing, since one can supply these character sequences in the other fields. How are these combined with the above operators?
The tude is the ":)" or ":(" operator. It's silly really. Things like [dumped :(] will find tweets that contain both "dumped" and some variation on the sad face.
Tags are just like other query terms but begin with #, like [#earthday]
The date operators seem clear enough. Then there is the total count of what is matched which is mostly missing with the exception that it unreliably appears at the end of a series of pages.
We do not provide a reslt count in the API for performance reasons. You can find out more about that my searching the list archives.
I'd appreciate your clarifying wisdom, signed 'Confused Seeker in SF'
