How to filter on metadata and query

Hi,

I want to filter on metadata as well as search query.

Here is my URL:

https://example.com/s/search.json?collection=collection1&query=anderson+AND+supervisor=Y&profile=_default_preview

The supervisor key is present in metadata JSON, and I only want those that have a value of “Y”. Sorry if docs exist for this, if there is a docs page for this please share. I couldn’t find it.

Thanks

You want to use something like this:

https://example.com/s/search.json?collection=collection1&query=anderson+AND+supervisor=Y&profile=_default&meta_supervisor=Y or possibly as a scoped and if you need to prefilter your results for items that have supervisor=Y

https://example.com/s/search.json?collection=collection1&query=anderson+AND+supervisor=Y&profile=_default&meta_supervisor_sand=Y

See the query language help: Funnelback query language and search query parameters :: Squiz DXP Help Center

P.S. Ensure you don’t search the _default_preview profile from a live search or analytics won’t get logged

Thanks. The second (scoped) parameter helped.

Do you have any documentation on profiles (e.g. default_preview) so we can learn more about this? I just want to check our live settings.

You can find out more information here. In the DXP/v16 a profile is called a results page, but it’s essentially the same thing.

Note: in v16 you don’t really use the _default profile anymore because creating a named results page/profile is done as part of setting up a search.