You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by "Aditya (Adi) Gupta" <ag...@clarity-us.com> on 2015/12/13 00:02:44 UTC

Issue in filtering the tweets

Hello,

I am trying to get the tweets for a specific word "ArvindKejriwal" and have tried the following but when I analyse the text the data is not relevant. Also I have put a filter for 'en' but the data in text is coming from all other languages.


I am putting the key word @ArvindKejriwal in GetTwitter processor but when I see the Text (part of JSON data) I see random text.

 [cid:image001.png@01D134FD.96F51770]

Then I added RouteOnAttribute and the property I am putting

${twitter.text:isEmpty():not():and(${twitter.lang:equals("en")})}

I am not sure how to get specific tweets for ArvindKejriwal.    Is there a way to do   and twitter.text:contains("ArvindKejriwal")  which I can add in the property here?

I was thinking that the GetTwitter should do..

Any direction will be greatly appreciated.
[cid:image002.png@01D134FD.96F51770]

Regards - Adi

Re: Issue in filtering the tweets

Posted by Mark Payne <ma...@hotmail.com>.
Adi,

Hello. You should not need to use a RouteOnAttribute to pull out only messages that you are interested in.
The GetTwitter processor has a property named "Twitter Endpoint." Which value do you have selected for
that property? The default value is "Sample Endpoint." This endpoint just returns a sample of approximately
1% of the Twitter data feed, without applying any sort of filters or anything.

If you want to receive only tweets that have the word "ArvindKejriwal", you should set the Twitter Endpoint to
"Filter Endpoint." Then, in the "Terms to Filter On" property, set the value to "ArvindKejriwal" and you should
be good to go. If you want to only accept tweets that are in English, you can certainly also set the "Languages"
property to "EN". The key though is to ensure that you are using the Filter Endpoint - otherwise, these settings
all will be ignored.

Should you wish to perform additional routing / filtering, you can certainly use additional processors to do so.
For example, you could use EvaluateJsonPath to pull out specific fields of interest and then use RouteOnAttribute
to then route based on those fields.

Does this help? Or are you still having trouble?

Thanks
-Mark


> On Dec 12, 2015, at 6:02 PM, Aditya (Adi) Gupta <ag...@clarity-us.com> wrote:
> 
> Hello, 
>  
> I am trying to get the tweets for a specific word “ArvindKejriwal” and have tried the following but when I analyse the text the data is not relevant. Also I have put a filter for ‘en’ but the data in text is coming from all other languages.
>  
> 
> I am putting the key word @ArvindKejriwal in GetTwitter processor but when I see the Text (part of JSON data) I see random text.
>  
>  
>  
> Then I added RouteOnAttribute and the property I am putting  
>  
> ${twitter.text:isEmpty():not():and(${twitter.lang:equals("en")})}                       
>  
> I am not sure how to get specific tweets for ArvindKejriwal.    Is there a way to do   and twitter.text:contains("ArvindKejriwal")  which I can add in the property here?
>  
> I was thinking that the GetTwitter should do..  
>  
> Any direction will be greatly appreciated.
> 
>  
> Regards – Adi


Re: Issue in filtering the tweets

Posted by praveenkotekal <pr...@gmail.com>.
Hi,
I am working on a similar issue. How do I filter on multiple conditions at
the same time. 

For example:
${twitter.text:isEmpty():not():and(${twitter.lang:equals("en")})} and some
other things like twitter.text.contains('amazon'). Please let me know how
this can be resolved.

Thank you



--
Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/