For SharePoint search, I create a KQL query that, among other things, sometimes checks whether an entity has one of several interesting substrings appearing in one particular property.
The property itself is a comma-separated list of integral IDs, and every atom of my body dislikes this solution, but apparently it works and at this point in time, it's what I'm working with.
So, we have the property
ReallyLongAndCumbersomeName that can look something like
245, 2451, 21, 96612, 5215.
And so a query can contain this:
(ReallyLongAndCumbersomeName:29 OR ReallyLongAndCumbersomeName:30 OR ReallyLongAndCumbersomeName:31 OR ReallyLongAndCumbersomeName:32 OR ReallyLongAndCumbersomeName:33 OR ReallyLongAndCumbersomeName:34 OR ReallyLongAndCumbersomeName:20 OR ReallyLongAndCumbersomeName:35 OR ReallyLongAndCumbersomeName:36 OR ReallyLongAndCumbersomeName:21 OR ReallyLongAndCumbersomeName:427382 )
So the question is, can I simplify this to something like
ReallyLongAndCumbersomeName:(29 OR 30 OR 21 OR 32 OR 33 OR 34 OR 20 OR 35 OR 36 OR 21 OR 427382)?