• I have a question about searching a summary fields te deliver exact results.

    I using the plugins to deliver results on a person namen. In some cases this happens:

    Searching for: “Jelle de Vries” results in showing results for a person named “Jelle Jacob de Vries” as well. 

    How can I make sure Relevanssi only returns the exact matches based on “Jelle de Vries” and not “Jelle Jacob de Vries”?

    Currently, settings are like this:

    Scherm-afbeelding 2024-04-10 om 12.41.49.png

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    You need some additional filtering code to remove the unwanted matches. The best solution depends on the context. Should this restriction be applied everywhere, or just in a specific place, like a custom field or a post title?

    A solution would be a filter function on the relevanssi_hits_filter hook. This hook gives you all the results in an array. You can go through the array and remove all the posts that don’t match your exact criteria.

Viewing 1 replies (of 1 total)
  • The topic ‘Search results whole words’ is closed to new replies.