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

Support archive

Search without submit button?

ngoncom 23 Apr 2014 16:17 question, complete

Hi Low!

I have a question about ability of Low Search. I want return search results without have to click submit button.

As this case, I set keyword in embed:

We have {embed="stuff/search-item" my_keywords="sony xperia z"} Xperia in store!

So, in embed template "stuff/search-item" I will place Low Search Result tag in it to perform search.

Above code return:

We have 5 Xperia in store!

is my willing!

Thank Low!

Replies

  1. Low 23 Apr 2014 19:48

    You can hard-code any of the Low Search parameters in the Results tag, so in your case, something like this:

    {exp:low_search:results keywords="{embed:my_keywords}" ... }

  2. ngoncom 24 Apr 2014 03:06

    Hi Low!

    I create template "test" and place this code:

    {exp:low_search:results keywords="sony xperia z"} 
    {title}
    {/exp:low_search:results}


    It return 2 products, when I search with this form:

    {exp:low_search:form result_page="search" form_id="search-form"} 

    {/exp:low_search:form}


    With keywords as above 'sony xperia z' it return 3 products. I try rebuild index, but nothing improvement!

    Second, I try add channel:

    {exp:low_search:results keywords="sony xperia z" channel="sony"} 
    {title}
    {/exp:low_search:results}


    Nothing return!

    Have I missing somethings? Thank Low!

  3. Low 24 Apr 2014 11:25

    What's the results tag in the /search template? Also, does the "sony" channel actually exist? You can turn on template debugging and look up all the lines that mention Low Search to get an idea of what's going on. Copy/paste those lines here for the cases you describe above.

  4. ngoncom 24 Apr 2014 17:04

    Hi Low!

    I thank you so much for your reply. I tried install fresh EE and Everything works perfectly! So, Low Search working as expected!

    I actually dont know why it not works well on my project, here is my debug:

    TEMPLATE DEBUGGING 
    (0.000000 / 4.20MB) - Begin Template Processing -
    (0.000000 / 4.20MB) URI: test
    (0.000000 / 4.20MB) Path.php Template: /
    (0.000000 / 4.20MB) Retrieving Template
    (0.000000 / 4.20MB) Parsing Template URI
    (0.001953 / 4.20MB) Template Group Found: test
    (0.001953 / 4.20MB) Retrieving Template from Database: test/index
    (0.002929 / 4.21MB) Template Found
    (0.002929 / 4.21MB) Retrieving Template from File
    (0.012695 / 4.44MB) Calling Extension Class/Method: Ce_cache_ext/template_pre_parse
    (0.014648 / 4.52MB) Calling Extension Class/Method: Mo_variables_ext/run
    (0.018554 / 4.57MB) Calling Extension Class/Method: Stash_ext/template_fetch_template
    (0.018554 / 4.56MB) Template Type: webpage
    (0.018554 / 4.56MB) Parsing Site Variables
    (0.018554 / 4.56MB) Snippets (Keys): ... ... ...|last_segment|current_url|current_path|current_query_string
    (0.018554 / 4.57MB) Snippets (Values): FALSE|test|1|59|... ... ...|/test/|http://project.com/test|1|desktop|test|http://project.com/test|test|
    (0.018554 / 4.57MB) Parse Date Format String Constants
    (0.018554 / 4.57MB) Parse Current Time Variables
    (0.018554 / 4.57MB) Parsing Segment, Embed, and Global Vars Conditionals
    (0.024414 / 4.60MB) - Beginning Tag Processing -
    (0.024414 / 4.60MB) Parsing Tags in Template
    (0.024414 / 4.60MB) Tag: {exp:low_search:results keywords="sony xperia z"}
    (0.024414 / 4.60MB) Closing Tag Found
    (0.024414 / 4.60MB) Processing Tags
    (0.025390 / 4.61MB) Module Tag: Low_search/results
    (0.025390 / 4.61MB) Including Files for Plugins and Modules
    (0.028320 / 4.77MB) Files for Plugins and Modules All Included
    (0.028320 / 4.77MB) Beginning Final Tag Data Processing
    (0.028320 / 4.77MB) Calling Class/Method: Low_search/results
    (0.028320 / 4.78MB) -> Class Called: Low_search
    (0.048828 / 5.29MB) -> Method Called: results
    (0.051757 / 5.30MB) Low Search: Applying Low_search_filter_keywords
    (0.053711 / 5.33MB) Low Search: Starting search (fallback)
    (0.058593 / 5.33MB) Low Search: Calculating relevance score
    (0.059570 / 5.33MB) Low Search: Setting fixed_order param
    (0.059570 / 5.33MB) Low Search: Parameters set: keywords="sony xperia z" search_mode="all" orderby="" sort="" fixed_order="46|58|52"
    (0.059570 / 5.33MB) Low Search: Pre-applying search vars to tagdata
    (0.060547 / 5.34MB) Low Search: Calling the channel module
    (0.122070 / 7.76MB) Calling Extension Class/Method: Low_search_ext/channel_entries_query_result
    (0.146484 / 8.61MB) Calling Extension Class/Method: Low_search_ext/custom_field_modify_data
    (0.150390 / 8.68MB) Calling Extension Class/Method: Low_search_ext/custom_field_modify_data
    (0.152343 / 8.68MB) Calling Extension Class/Method: Low_search_ext/custom_field_modify_data
    (0.154297 / 8.68MB) Calling Extension Class/Method: Low_search_ext/custom_field_modify_data
    (0.155273 / 8.68MB) Calling Extension Class/Method: Low_search_ext/custom_field_modify_data
    (0.157226 / 8.68MB) Calling Extension Class/Method: Low_search_ext/custom_field_modify_data
    (0.161132 / 8.61MB) -> Data Returned
    (0.161132 / 8.60MB) - End Tag Processing -
    (0.162109 / 8.60MB) Calling Extension Class/Method: Mo_variables_ext/cleanup
    (0.163086 / 8.60MB) Calling Extension Class/Method: Stash_ext/template_post_parse
    (0.163086 / 8.60MB) - End Template Processing -
    (0.163086 / 8.60MB) Parse Global Variables
    (0.165039 / 8.60MB) Template Parsing Finished
    Memory Usage: 9,036,440 bytes


    The line (0.059570 / 5.33MB) Low Search: Parameters set: keywords="sony xperia z" search_mode="all" orderby="" sort="" fixed_order="46|58|52" seem Low Search return 3 results, but it only display 2 results!

    I am using EE 2.7.3, Low Search 3.1.4 and installed some module:
    - ce_cache
    - ifelse
    - mo_variables
    - seo_lite
    - snaptcha
    - stash
    - switchee
    - wygwam
    - zoo_visitor...

    Thank so much!

  5. Low 24 Apr 2014 20:40

    It could be that the entry that isn't returned has a different status than 'Open', or its entry/expiration dates fall outside the threshold of what is allowed back. Regular standard EE channel:entries filtering still applies, so that could be it.

  6. ngoncom 25 Apr 2014 02:46

    Hi Low, that appreciate help!

    I am very sorry for spending your time, the problem is status (I have an entry with status not = open) causing wrong results.

    {exp:low_search:results keywords="sony xperia z" status="not closed"} 
    {title}
    {/exp:low_search:results}


    Above code works well!