Gnip does not accept a rule containing #



When I try to add a rule with hashtags, the rule is rejected from Gnip and it is not added to it. Otherwise, if a make a rule without # I don’t get any problems and all work fine.
This is an example of a rule: (word1 OR word2 OR #hashtag1 OR #hashtag2) -(blackWord1 OR blackWord2) (lang:en)



I certainly can not reproduce that issue… A large percentage of PowerTrack rules contain the hashtag Operator, and your syntax is correct. So, please reach out to the Gnip support channel, and let us know the exact rule you are adding, the error message received, and confirm which version you are using (PowerTrack 1.0 or 2.0).



Thank you for your reply. So if I understand the two syntax are correct (with the hashtag operator and without it)? And what about the restrictions mentioned in the Gnip documentation?

Must the hashtag operator be quoted?


It’s so confusing, I’m testing today with the same syntax and it works! Am I the only one who has the same problem? Can I have explanation about this Gnip issue?


Hello again,

Filtering on #snow and “#snow” would yield slightly different results. Without quotes, #snow, explicitly filters on Tweets with the exact #snow hashtag (matching in the hashtags provided in the ‘twitter_entities’ payload). Due to how PowerTrack tokenizes around whitespace and punctuation, “#snow” would additionally match on #snow_man. So, using quotes will match on more Tweets, and if you are targeting specific hashtags, the hashtag Operator (i.e., #) is recommended.

I was not able to produce your original issue with loading rules with the # Operator (and again this Operator is one of the most commonly used Operators), so I don’t think this was a Gnip rule validation issue, and likely caused by something else like how the rule was JSON encoded. Without seeing the returned error message, it’s hard to know. Regardless, glad you figured it out.