If you fill out some advanced search page and actually do a search, it will fill the search box with the constructed query string. For example, if I configured it as follows:
- All these words: word1 word2
- Any of these words: word3 word4
- None of these words: word5
- From these accounts: user1 user2
- Mentioned these accounts: user3
"word1 word2 word3 OR word4 -word5 from: user1 OR from: user2 @ user3"
Then you simply paste this line into your generated query.
Query query = new Query("word1 word2 word3 OR word4 -word5 from:user1 OR from:user2 @user3");
source share