Forums

Relevanssi - A Better Search
[resolved] Synonym help (9 posts)

  1. deadhippo
    Member
    Posted 11 months ago #

    I'm trying out the synonym function but I can't seem to get it to work. Can someone tell me what I am doing wrong?

    I tried this originally

    whale = whales

    and then

    whales = whale

    and then

    'whale = whales'
    'whales = whale'
  2. msaari
    Member
    Posted 11 months ago #

    Do you have OR operator enabled?

  3. deadhippo
    Member
    Posted 11 months ago #

    No. I have the AND operator enabled because I have the post date as the default order for the dates. I know that this is not how you imagined people using your search but I have good reasons. In my site the latest posts are the most relevant in most cases because the older posts are older products and may be sold out or discontinued.

    And also don't want the results for "star" showing up when people search "star wars", even if all the star wars posts appear first.

    I guess from your question though that I won't be able to use the synonym function with my current settings.

  4. msaari
    Member
    Posted 11 months ago #

    Yes, synonym function only works with OR queries (it turns "whale" to "whale OR whales").

    You don't have to use AND when you order by post date, those two are not connected. However, using AND is generally a good idea that leads to better results than OR search, as you've noticed.

    Supporting synonyms with AND operator would require more complex search logic which I haven't felt necessary to build so far. It's complicated and only useful in limited cases.

  5. deadhippo
    Member
    Posted 11 months ago #

    No worries. I guess I'll just add plurals to the tags. Thanks.

  6. whiteorb
    Member
    Posted 3 weeks ago #

    So what is the proper format?

    whale = whales
    whales = whale
    'whale = whales'
    'whales = whale'

    Are they comma separated?

  7. msaari
    Member
    Posted 3 weeks ago #

    No apostrophes or commas, just one synonym pair per line.

  8. whiteorb
    Member
    Posted 3 weeks ago #

    So whales = whale or whales=whale

  9. msaari
    Member
    Posted 3 weeks ago #

    Both work.

Reply

You must log in to post.

About this Plugin

About this Topic