Filter based on URL or strings based on partial matches




I am trying to implement filter thru JS. How do we do filter based on string, text functions like begins, contains, partial match etc.

e.g. I would like to filter based on if the URL contains the path /data-sheet/ or URL starts with ‘ /data-sheet/’. I was thinking something like this, but it does not work.
filters: {‘page’: {‘url’: ‘*/data-sheet/*’}}

I would like a solution without using meta tags. (1. Some pages i can’t add meta tags since they are externally sites 2. others are file URLS ( /data-sheet/product1.pdf)


Hi Trevor,

At the moment it’s not possible to filter results based on url path matches. For the domains you do have control over we recommend the use of metatags to create custom fields. For those that you don’t have control over, we can assist in extracting values that you can filter by as long as there is a consistent path structure for those additional domains.

Please reach out to us via the Support form in your Swiftype dashboard and we can discuss further. :slight_smile: