0

EE 2.10.1

OK, so I haven't ever actually used EE's native search functions (always use add-ons or craft my own module to function as a search appliance [because of stupidly complex ERDs so weird there was no viable way of importing them into EE channels]).

Using the EE Simple Search, I have a code example like this:

{exp:search:simple_form
   channel="product_review"
   result_page="products/search"
   no_result_page="products/search"}

    <p>
        <label for="keywords">Search:</label><br>
            <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100">
    </p>
    <p>
        <input type="submit" value="submit" class="submit">
    </p>

{/exp:search:simple_form}

... which seems fine.

However, the resulting URL, regardless of if there is a result or not, looks like this (third segment seems variable, but always a hash-like string):

www.domain.com/products/serach/0568f4f2a81172d816bb05364030a4c4/

What the hell is that that third segment? It's not a template annotation.... I rarely have a question to ask, so can anyone provide insight on the native {exp:search:simple_form} returns? I'd just like to get ride of it without .htaccess rules. I'm sure I'm missing something in the docs or have something in the config set up wrong.

1 Answer 1

0

It took me a while to find an old website that used native searching as I always tend to use Low Search, but eventually found it...

Like low search the URL is a unique identifier to the conducted search, so it can be repeated and is shareable tracked. The third segment is the key reference in the database table, identifying the user, date searched, keywords used, and other information.

exp_search table grab

So even if there are no results, the information will still exist on what they searched for, meaning there is still a third segment.

The display of the results isn't reliant on POST data, but on the URL, so you can't remove it and can't hide it, otherwise it's not shareable or repeatable.

2
  • Ack. Thanks for the detective-ing. I'll try the advanced search but I'm betting we get the same results.
    – jrothafer
    Nov 21, 2015 at 16:56
  • Peter is right, but the comparison with Low Search is not entirely accurate. The hash used by the native search is a temporary key that will expire, making native searches non-shareable. The encoded query that LS uses, on the other hand, can be decoded and read any time, so do not expire, making those URLs truly shareable.
    – Low
    Nov 21, 2015 at 19:05

Your Answer

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

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