0

I'm using a search results web part connected to a search box and I'd like to get everything within the site except items of a specific content type. My query originally looked like this:

{searchTerms} Path:{Site} 

I can get only matching results from a list with the content type like this

{searchTerms} Path:{Site} ContentType:My Content Type Name

I've tried multiple combinations such as putting a - before ContentType, adding NOT before ContentType, and adding AND NOT but there are very few values returned each time (I'm sure this should not be the case). Is there a way to get everything except these types of items?

2

If yo want to remove a specific content type use either the exact name in a equals query (note the quotes and the minus):

{searchTerms} Path:{Site} -ContentType="My Content Type Name"

Or use the content type ID (replace the ID with your own):

{searchTerms} Path:{Site} -ContentTypeId=0x0101006090CA8B789FE54589E1936EEC912F6E01

If the content types are children you can exclude the content with a wildcard as well.

{searchTerms} Path:{Site} -ContentTypeId=0x0101006090CA8B789FE54589E1936EEC912F6E*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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