Contains_near csdl


#1

Is this type of filter possible using contains_near? Thanks.

fb.content contains_near “coke,sugar:10” OR fb.content ANY “sprite, fanta”


#2

Yep. You can use the contains_near operator in combination with other operators (as you’ve done here) without any problems.


#3

This filter wouldn’t validate, can a contains_near have more than one string?

fb.all.content contains_near “rental,car:5,rental,van:5,rental,vehicle:5,rental,truck:5”

This filter did validate, is there a way to construct it with one contains_near operator?

fb.all.content contains_near “rental,car:5” OR fb.all.content contains_near “rental,van:5” OR fb.all.content contains_near “rental,vehicle:5” OR fb.all.content contains_near “rental,truck:5”


#4

contains_near can take several strings, but works in a slightly different way than you’ve written. For example:

fb.all.content contains_near “rental,car,van,vehicle,truck:5”

is technically legal, but would require all 5 words to be in a proximity of 5 words of each other. I don’t think that’s what you’re looking for.

Your last filter is the only way that I can think of to specifically match interactions with content containing “delivery” within 5 words of “car”, “van”, “vehicle”, or “truck”, unless you can come up with a clever regex to match that way: http://dev.datasift.com/docs/platform/csdl/csdl-language/operators/regexpartial

contains_near documentation: http://dev.datasift.com/docs/platform/csdl/csdl-language/operators/containsnear