1

I want to create result source that would give results for only two content types from particular site. So, lets say at our site we have couple of different content types content types - A , B, C, D. Whats the keyword query language (KQL query) that I need to write so I can see in my result page only items that are containing content types A and B. I was going with : {{searchterms} path:http://intranet ContentType:A and ContentType:B} but its not working, I'm not getting the wanted results.

1 Answer 1

3

try this one to get result which are related to this content types ContentTypeId:0x0103* AND ContentTypeId:0x0108*

4
  • Hi Nagaraju,thanks for the answer but that's not the solution I want, cause AND operator is giving results for items where both content types are included. I need all items that include content type A and all items from content type B.
    – JovicaS
    Feb 24, 2015 at 12:14
  • Then you can use OR, it would be show all items of both A and B content types. Feb 24, 2015 at 12:20
  • 2
    I succeed, the problem with the or query was the missing close brackets my query was: [WRONG] {{searchterms}page:intranet ContentType:A OR ContentType:B} - I was getting results for items only for contenType:B. [TRUE] {{searchterms}page:intranet (ContentType:A) OR (ContentType:B)} Thanks you for the effort Nagaraju.
    – JovicaS
    Feb 24, 2015 at 12:56
  • but what If I have query like ((Condition1:Value OR Condition2:Value) AND (Condition3:Value AND Condition4:Value))? How should I write in KQL? Feb 7, 2018 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.