I want to query Stack Exchange by title including optional keywords (one of).
How can I query by OR operator?
/search/advanced?page=1&tagged=java&q=title:http OR class&order=desc&sort=votes&site=stackoverflow
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It only takes a minute to sign up.Sign up to join this community
The API currently does not support this, but then neither does the website itself.
The "How do I search?" help page says:
To combine results from multiple tags, separate the tag names (enclosed in square brackets) with the word "or":
[widgets] or [geegaws]returns questions tagged with either tag.
Note that it only refers to tags in conjunction with the
or operator. No facility is made for general
Example on the main site:
[winzip] title:folder makegives 3 results (currently).
[winzip] title:folder automategives 1 result
[winzip] title:folder make or automategives no results, when it should give at least 3 (fail).
[winzip] title:folder (make or automate), etc., also fail.
The Most timely/accurate workaround is: for each of the optional terms, search separately and then combine the results (stripping duplicate matches).
[java] title:http class(only 3303 results, currently).
[java] title:http foo(81 results).
question_ids for the final (net) results
This is annoying and inefficient, but it works and is easy to automate.
Other possible workarounds include using a SEDE query, or using a Google search with the