2

New to the lovely Low Search, so apologies for likely dumb question.

I've a single Input search form, that I'd like to use to search both entry titles (in one channel/collection) as well as one specific Grid field.

So far I seem to be able to get Entry Title results with:

{exp:low_search:form result_page="root/search_results" }
  <fieldset>
    <label for="keywords">Keywords</label>
    <input type="search" name="keywords" id="keywords" />
    <button type="submit">Search</button>
  </fieldset>
{/exp:low_search:form}

Or, results from the custom Grid field with:

{exp:low_search:form result_page="root/search_results" }
  <fieldset>
    <label for="keywords">Keywords</label>
    <input type="search" name="search:downloads:reference" id="reference" />
    <button type="submit">Search</button>
  </fieldset>
{/exp:low_search:form}

I don't seem to be able to get an either/or type result going on. On a basic level, I'd only really want the entry_title / url_title. I'm likely missing a key fundamental of the setup somewhere along the line so all help hugely appreciated even if it involves calling me dense ;)

Ta!

EE 2.8.1 / Low-Search 3.1.6

2 Answers 2

2

I'd recommend creating a Collection where you only add weight to the Title and the Grid field. Make sure the reference column in the Grid field's settings is marked as searchable. If it wasn't searchable before, you might need to re-save the entries so it populates the exp_channel_data table, which in turn Low Search uses to build its index.

Then you could use this:

{exp:low_search:form result_page="root/search_results" }
  <fieldset>
    <label for="keywords">Keywords</label>
    <input type="search" name="keywords" id="keywords" />
    <input type="hidden" name="collection" value="my_new_collection" />
    <button type="submit">Search</button>
  </fieldset>
{/exp:low_search:form}

...where my_new_collection is the collection described above.

1

Try using the 'search:title' parameter instead of keywords, and use that with your grid search:

{exp:low_search:form result_page="root/search_results" }

    Title: <input type="search" name="search:title">
    Grid: <input type="search" name="search:downloads:reference">

    <button type="submit">Search</button>
{/exp:low_search:form}

Update: Or alternatively, using a keyword search field and adding the field searches to the results tag:

{exp:low_search:results 
    query="{segment_3}" 
    search:title="{low_search_keywords}"
    search:downloads:reference="{low_search_keywords}"
    limit="10"
}
  ...
2
  • Hi.. that would work.. but obviously adds a second input tag. I'm trying to get this working on one "shared" input if that is possible :) Commented Jul 23, 2014 at 13:34
  • In that case, you should be able to use the keywords as the search field and then add the grid and title search as parameters to the results tag. Commented Jul 23, 2014 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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