Querying several page fields, some empty
-
10-12-2020 - |
Question
This probably has a very straight-forward answer, but I just can't get my head around it.
I've built a Search Result Web Part checking whether five column on the page are filled out and if so, presents the contents of those five columns.
This is my Query:
{Page.Leder 1} OR {Page.Leder 2} OR {Page.Leder 3} OR {Page.Leder 4} OR {Page.Leder 5}
It perfectly presents the five results when and ONLY when all five columns are filled out. But if only 4 are filled (ie. one is empty) it returns nothing!
Hope someone with KQL experience can help!
Solution
So I digged a great deal more and came up with this Query (partly by chance :o) ).
+{?{Page.Leder 1}} OR +{?{Page.Leder 2}} OR +{?{Page.Leder 3}} OR +{?{Page.Leder 4}} OR +{?{Page.Leder 5}}
And it Works a charm! This disregards the empty field and presents the fields from eg. Leder 1, Leder 3 and Leder 4.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange