#community-help

Excluding Documents in Search Results Based on Criteria

TLDR Jameshwart wanted to exclude certain documents in search results. Elian provided a link for assistance and Jason gave advice on overriding preset parameters.

Powered by Struct AI

1

3
1w
Solved
Join the chat
Nov 20, 2023 (1 week ago)
Jameshwart
Photo of md5-283d3397742c32cc2b6be6bda508c03e
Jameshwart
07:50 AM
is there an easy way to exclude all document to be excluded in result if a certain criteria is met?

for example by default I don't want to have a product in the response if the product status is draft/pending/trash so by default only publish products be the response. Unless i specified that I want a draft product to be the result
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:49 PM
Side note: parmeters inside presets can be overriden by the search parameters. So if you don't want an end-user looking at the browser requests to modify the filters you set inside presets, you want to instead embed that filter_by inside a Scoped Search API key

1