My twitter4j code snippet looks like this:
FilterQuery query = new FilterQuery();
String[] keywordsArray = { "python", "java", "scala" };
query.track(keywordsArray);
This works fine. But if I want to fire a query like: "python" AND ("java" OR "scala"), I am not able to get the right way of doing it. I basically want tweets which always have word "python" in it and in addition to that any of the words from second list i.e. "java" or "scala".
All my attempts have failed. Any idea how I can solve this?
I'm afraid there isn't a way to express that query through the streaming api.
You will have to filter for one of the terms, i.e. 'python', and then inspect the text of each Status
for either 'java' or 'scala'.
For more information, take a look at the documentation on the track
parameter.