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

Support archive

If low_search_no_result do another search

Phil 20 Nov 2019 01:05 question, complete

What I want to do is: if there is no result:

1. Get searched keyword
2. Search another table (not EE detfault table)
3. If found $results
4 Use $results to make another low Search

See attached image

Replies

  1. Low 20 Nov 2019 08:49

    Not possible for several reasons:

    - Using PHP here will mess up the template; you'd need both on input and on output, which is not possible.
    - Using the format="raw" in the conditional is a security risk, as anyone could put EE tags in there which would then invalidate the template (and with PHP enabled would be totally open to disaster)
    - Nesting identical tags (Results in this case) is not possible in the EE template parser.
    - Low Search only searches channel entries; not sure what you mean with 'not EE default table', but chances are LS cannot search that not-EE table.
    - The query="" parameter does not take raw keywords, but rather a fully encoded query.

    You've already got required="keywords" on the form, so you should always have keywords in the Results tag.

  2. Phil 20 Nov 2019 20:18

    I am trying to see if I can use LS to solve my problem:

    I have a table that has EE entries aliases and EE entries page titles (I manually created this table and imported data, it's not part of default EE database tables)

    My customers know some of the entries by aliases,
    What I need to do is, when a customer searches using an alias, before showing that the entry is not found,

    I want to do a search on the table if alias is found, if it is found, match the alias with entry title and use
    LS to search entries with that entry title, and display results

    THEN if not found,show the message that what you searched for not found

  3. Low 21 Nov 2019 11:50

    Why not add a field 'aliases' to your entries, add that field to the search collection of that channel, making entries searchable on title, alias and other searchable fields? No need for awkward redirects or searching non-native tables (which LS cannot do).