CSDL filter comparison


#1

Would these 2 filters retrieve the same data?

(fb.language == “en” AND fb.author.country == “United States” AND fb.content ANY “iPhone,#iPhone” AND fb.content ANY “#photography,photo” AND NOT fb.content any “nelzthedon,FREE,/photo/1”) OR (fb.parent.language == “en” AND fb.parent.author.country == “United States” AND fb.parent.content ANY “iPhone,#iPhone” AND fb.parent.content ANY “#photography,photo” AND NOT fb.parent.content ANY “nelzthedon,FREE,/photo/1”)

(fb.language == “en” AND fb.author.country == “United States” AND fb.content ANY “iPhone,#iPhone” AND fb.language == “en” AND fb.author.country == “United States” AND fb.content ANY “#photography,photo” AND NOT fb.language == “en” AND fb.author.country == “United States” AND fb.content any “nelzthedon,FREE,/photo/1”) OR (fb.parent.language == “en” AND fb.parent.author.country == “United States” AND fb.parent.content ANY “iPhone,#iPhone” AND fb.parent.language == “en” AND fb.parent.author.country == “United States” AND fb.parent.content ANY “#photography,photo” AND NOT fb.parent.language == “en” AND fb.parent.author.country == “United States” AND fb.parent.content ANY “nelzthedon,FREE,/photo/1”)


#2

No, the second filter will not match any interactions. Within each set of parentheses of the 2nd filter:

AND fb.language == "en" 
...
AND NOT fb.language == "en" 

requires that an interaction must simultaneously have fb.language == english and fb.language != english, so it cannot match any interaction.

It’s also not necessary to have multiple identical fb.language, fb.author.country, etc. targets if AND is connecting them all logically any way.

The Logical Operators doc on our dev site is a good resource for this.