Checking for the existence of interaction.geo


Is the query interaction.geo geo_radius “51.4553,-0.9689:50” the same as interaction.geo exists AND interaction.geo geo_radius “51.4553,-0.9689:50”?
So you don’t have to make sure that something exists before you look at its value?


In a query like interaction.geo geo_radius "51.4553,-0.9689:50", if there is no geo data in the interaction, this filter will simply not match it. You do not also need to specify that geo data exists.


Imagine we are looking at it from the other way around, and looking for Tweets that do NOT come from within this geo radius:

  interaction.geo exists AND NOT interaction.geo geo_radius "51.4553,-0.9689:50"

Notice that we have had to specify that interaction.geo exists here, otherwise Tweets which do not have any geo information will still be matched as the filter condition will be true - the interaction does not match the filter: interaction.geo geo_radius "51.4553,-0.9689:50"





Thanks for your reply. What if we wanted to catch all tweets that come from say either London, Paris, or New York? Could we use some form of the IN keyword or would we have to OR together three interaction.geo expressions?


Take a look at the larger examples on our geo_raduis documentation page. because geo_radius is already an operator (like the IN operator), you will have to OR each of the geo_radius statements together.