Thanks for the additional information on your record structure.
There is no way to automatically exclude a URL from being searched if it is part of the text of a
searchableAttributes - in this case your
Based on the sample records, to exclude record 2 from a search for “facebook” you would have to do some work to restructure your data or add a query rule.
Restructure Data: One approach would be to duplicate the
description field and call it
description_without_url. Then you can set
description_without_url as a
searchableAttributes and the original
description as the
Query Rule: This one assumes you know every word of what you want to exclude. You can use a query rule to add a filter removing the objectID of the specific record to exclude, if the query contains
I do want to note that without implementing anything extra, the standard Algolia relevance setup would list record 2 before (more relevant) record 1.
I hope this helps! Happy coding.