Issue with parenthesis


#1

Hello,

I experience strange issue with using parenthesis in CSDL expression:
Following does not work (i.e. no tweets received at all without any error message) though compiles successfully:
interaction.type == “twitter” and (interaction.content contains “me”)

However following works fine:
interaction.type == “twitter” and interaction.content contains “me”

Could you please advise if this is a bug or I am missing something in CSDL syntax?

Thanks,
Artsiom


#2

They should both receive exactly the same interactions. I have done some testing, and can't seem to find a problem with this. Were you running these streams through the web interface or through the streaming API?

If you are still experiencing problems with this, could you send me the stream hashes so I can take a further look?


#3

I’ve got the same problem over here.


#4

Hi there - I have had the same problem - and with the same query type which was working before for weeks before - the query simply ceased to produce results. No errors, exceptions or suggested alternatives were returned by the API - so I’d be interested to hear if there is something incorrect with the syntax that is being submitted. The query is as follows - and the nature of the syntax is the result of parsing from a proprietary query. (((twitter.text contains “kangaroo” ) and (twitter.text contains “australia” ) ) )


#5

There are a few things you may want to check:

  • Ensure your stream is still connected as expected.
  • Ensure you have turned on the data sources you expect to be receiving data from at http://datasift.com/source
  • Try compiling the stream through the web interface; here you have access to a small console, and can instantly see a free preview of your returned results.

Also, parentheses are not required around every filter term; They are only required to group filter terms.

For example;

  (twitter.text contains "kangaroo" and twitter.text contains "australia" ))

is an unnecessary use of parentheses, as the following will achieve exactly the same results:

  twitter.text contains "kangaroo" and twitter.text contains "australia"

The following is an example of a case where you would need to use parentheses:

  twitter.text contains "kangaroo" and twitter.text contains "australia" or twitter.text contains "Sydney Zoo")

This would look for Tweets mentioning kangaroos, and either Australia, or Sydney Zoo.

 

If you are still having issues, please send the problematic stream URL or CSDL definition to DataSift Support