contains_near with multiword phrase?


#1

How can I use contains_near with a multiword phrase?

interaction.content contains_near "crime,Hackney:5" or interaction.content contains_near "beer,Hackney:5" or interaction.content contains_any "Dalston" validates successfully, whereas interaction.content contains_near "crime,Hackney:5" or interaction.content contains_near "beer,Hackney Wick:5" or interaction.content contains_any "Dalston" generates the following response body: "error": "We are unable to parse this stream. At line 1 position 103 we were expecting a colon (:)" What I'm trying to achieve, obviously, is to match occurrences of 'beer' within 5 words of the phrase "Hackney Wick". Is there any way to do this? There doesn't seem to be any alternative was to express this match, which doesn't produce either false positive or false negatives?

#2

Hi,

Unfortunately the contains_near operator is not compatible with spaces. This is documented on the contains_near page.

You should be able to achieve something similar using a regex operator.