All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

low_search suggestions not appearing

Justin Koivisto 30 May 2017 19:12 question, complete

in regards to low_search...

I have collections set up, and they all have a default language assigned. I have built the lexicon and am using the suggestions tag. I have it set up with the following parameters.

{exp:low_search:suggestions
keywords='{segment_7}'
keywords:lang='en'
limit='1'}
Did you mean {suggestion}?

{if no_suggestions}
<!--
No suggestions found.
keywords='{segment_7}'
keywords:lang='en'
-->
{/if}
{/exp:low_search:suggestions}

I don't get suggestions when I search "thomason" when there is a "thomasson" in the lexicon. I'm trying to find out how to make a suggestions appear for an employee directory. I've tried adding distance='3' as well as trying method='soundex' with no change in the results.

What am I missing?

Replies

  1. Low 30 May 2017 19:29

    Can you enable the template debugger and copy/paste all lines that mention Low Search here?

  2. Justin Koivisto 30 May 2017 20:11

    0.008886 / 2.9MB Calling Tag: {exp:low_search:suggestions keywords='thomason' keywords:lang='en' limit='1'}
    0.009409 / 3.0MB Low Search: Prepping if no_suggestions conditional
    0.010305 / 3.0MB Low Search: No valid words to base suggesions on
    0.010320 / 3.0MB Returning No Results Content
    0.010366 / 3.0MB -> Data Returned
    0.010495 / 3.0MB Calling Tag: {exp:low_search:results channel='care_team' orderby='ct_last_name|ct_first_name' dynamic='no' sort='asc' keywords:loose='both' keywords:mode='any' category='not 376|377|378' keywords='thomason' limit="12" }
    0.011187 / 3.0MB Low Search: Applying Low_search_filter_keywords
    0.011311 / 3.0MB Low Search: Keywords: thomason
    0.011390 / 3.0MB Low Search: Starting search (fallback)
    0.011743 / 3.0MB Low Search: Searched but found nothing
    0.011762 / 3.0MB Low Search: Filters found no matches, returning no results
    0.011774 / 3.0MB Returning No Results Content

  3. Low 30 May 2017 20:23

    The log says "No valid words to base suggesions on" which in this case means that "thomason" is present in the lexicon. Suggestions are only given for words that are not in the lexicon.

    You can check by looking it up in the CP. If it doesn't belong there, you can then remove it. Just make sure it isn't present in any entry, regardless of entry status/expiry date, etc.

    To verify, try a different keyword, like 'tomasson' or 'thomassom' -- something you're absolutely sure is not in the lexicon (and again, verify by looking it up in the CP).

  4. Justin Koivisto 30 May 2017 20:31

    Perfect! That must have accidentally been added when I was trying to figure out how it all worked. Once I removed it, the suggestion worked fine.

    Thank you!