1

I've been looking through this site for examples of Low Search results tags not using encoded queries but I can't find any and I think I must be doing something wrong.

By default on my page I have this which displays all results which is what I want:

{exp:low_search:results
    collection="people" {!-- have tried both channel and collection --}
    disable="member_data|relationships|trackbacks"
    orderby="people-lname"
    sort="asc"
    limit="10"
    pagination="bottom"
    {if segment_2}
    query="{segment_2}"
    {/if}
}

I also have a search form on the page:

{exp:low_search:form result_page="people"}
  <input type="text" name="keywords" id="keywords">
  <button>Submit</button>
{/exp:low_search:form}

If I do a search for a person's surname (which is part of the entry title), I end up on a page like domain.com/people?keywords=surname which is again what I want, but I get no results.

Edit: this is the output after turning on template debugging:

0.052283 / 3.2MB Calling Tag: {exp:low_search:form result_page="people"}
0.056505 / 3.4MB -> Data Returned
0.058679 / 3.4MB Calling Tag: {exp:low_search:results   channel="people"   disable="member_data|relationships|trackbacks"   orderby="people-lname"   sort="asc"   limit="10"   pagination="bottom"  }
0.062416 / 3.5MB Low Search: Applying Low_search_filter_keywords
0.063155 / 3.5MB Low Search: Keywords: surname
0.063360 / 3.5MB Low Search: Starting search (fulltext)
0.064107 / 3.5MB Low Search: Searched but found nothing
0.064146 / 3.5MB Low Search: Filters found no matches, returning no results
0.064183 / 3.5MB Returning No Results Content
0.064245 / 3.5MB -> Data Returned  
1

Looking at the template debugging output, I can see the query is being picked up correctly and handled normally. If you're not getting results, make sure of the following:

Not using the collection= parameter will search all collections, but limit results to the given channel, ie. people. So, make sure the people channel has at least one collection associated and that collection has at least one searchable field weighted 1 or more. Fields with a weight of 0 are excluded from the index. Also make sure the index for that collection is built.

The debug data mentions "Searched but found nothing", which means a database query was fired using the given keywords (surname), but it didn't find a match in the collection index. This means either the above (the keyword is present, just not in the available collections and their weighted fields) or it means the keyword isn't present in the entries you're searching through, ie. no entries exist that contain the string surname.

  • Thanks Low. It was because I hadn't weighted fields for the collection. 👍 – Tyssen Dec 29 '20 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.