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

Support archive

Search results not showing with a simple search

Merv 19 Feb 2014 09:24 question, complete

Bought Low Search today. I am trying it step by step, but unable to get a result from a simple implementation of a search consisting of a dropdown list that searches channel entries based on the city name. I have copied the search code from the example provided in the documentation. The dropdown list gets populated, but the result page gives me this message:" Sorry, your query did not return any results. Check your spelling or try a different search term."

Here are the EE elements:
--------------------------------------
The channel name is "wellness_centers"
The field being searched is "practitioner_city"

Here is the code of the search page:
-----------------------------------------------
<!DOCTYPE html SYSTEM>

Main Page

{exp:low_search:form
collection="wellness_centers"
query="{segment_2}" {!-- Don’t forget this! --}
result_page="directory/filtered-results-wellness-centers-v2" {!-- Can also be defined in the Settings. --}
form_id="search"
}

City

{exp:query sql="SELECT DISTINCT field_id_9 FROM exp_channel_data ORDER BY field_id_9 ASC"}
{field_id_9}
{/exp:query}

Any
All
of the above

Search

{/exp:low_search:form}

Here is the code of the result page:
-----------------------------------------------

<!DOCTYPE html SYSTEM>

Main Page

{exp:low_search:results
query="{segment_2}"
status="not closed"
disable="member_data|category_fields"
}

{if count == 1}

{if low_search_keywords}Searched for {low_search_keywords}.{/if}
Total results: {absolute_results}.


{/if}

{title}
{entry_id} | {entry_date format="%Y-%m-%d"} | {channel}

{if low_search_collection_id}

Found in {low_search_collection_label} with a score of {low_search_score}.


{/if}
{low_search_excerpt}

{if page_url}
{page_url}
{if:else}
{comment_url_title_auto_path}
{/if}


{paginate}
Page {current_page} of {total_pages} pages {pagination_links}

{/paginate}

{if low_search_no_results}

Sorry, your query did not return any results.
Check your spelling or try a different search term.


{/if}

{/exp:low_search:results}

Thank you

Merv

Replies

  1. Low 19 Feb 2014 09:28

    Your result page points to "directory/filtered-results-wellness-centers-v2", while your query="" parameter takes in {segment_2}, which then is "filtered-results-wellness-centers-v2", not the encoded search query.

    Change the query param to query="{segment_3}".

  2. Merv 19 Feb 2014 09:36

    Many thanks for your quick reply. I corrected it, but now I am getting the following error message:

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined property: EE::$addons

    Filename: filters/lsf.tags.php

    Line Number: 25

    Fatal error: Call to a member function is_package() on a non-object in /var/www/html/system/expressionengine/third_party/low_search/filters/lsf.tags.php on line 25

  3. Low 19 Feb 2014 09:39

    That'll be a bug that will be fixed in the upcoming version, to be released later today.

    Here is the fix for now.

  4. Merv 19 Feb 2014 09:46

    OK fixed. I can now continue with the journey....

    Thank you