0

Am i right in thinking

loose_ends="right"

Takes no notice of anything to the right of what you searched for?

Here is the matrix field i am searching.

enter image description here

Basically this would be an example search.

enter image description here

What i was hoping is that the [loose_ends="right"] would take no notice of the "HE" and return the entry with "LL28 3" in one of the rows but it doesnt at the moment.

In order for it to work i need to type "LL28 3" and submit the search. It will then return the entry.. is there a way that i can get it to work with the "HE" or whatever else letters is added after?

This is my code i have at the moment.

SEARCH:

 {exp:low_search:form result_page="search/results" form_id="postcodesearch"}
                <fieldset>
                    <label>Enter your postcode:</label>
                    <input type="search" name="keywords" placeholder="Enter your postcode here" class="postcode-entry" />
                    <button type="submit" class="white-button postcode-button"><span class="fa fa-search icon"></span>Search your postcode</button>
                </fieldset>
  {/exp:low_search:form}

RESULTS:

{exp:low_search:results query="{segment_3}" limit="1" collection="franchise" loose_ends="right" channel="franchise"}

    {if count ==  1}<ol>{/if}
    <li><a href="{comment_url_title_auto_path}">{title}</a></li>
    {if count == total_results}</ol>{/if}
    {if no_results}No search results{/if}

{/exp:low_search:results}

Thanks

1

Am i right in thinking loose_ends="right" takes no notice of anything to the right of what you searched for?

No. To quote the docs:

right: lion will match lions and lionized.

...which means the search term lion will return entries that contain lions or lionized.

Based on your description, you're expecting the opposite: eg. lionized will also return lion. That wouldn't be desirable behaviour.

is there a way that i can get it to work with the "HE" or whatever else letters is added after?

Only if you change the submitted keywords yourself, either with JavaScript on form submit, or using an extension which hooks onto the low_search_pre_search hook.

3
  • Thanks Low, wouldnt have the first clue how to go about that. Way over my head. Would it be quick and painless for someone that knew what they were doing? Sep 25 '14 at 15:52
  • Depends on what the rules and formats for determining the post codes are. Contact me if you need a quote for such an extension.
    – Low
    Sep 25 '14 at 16:04
  • Brilliant, I will do when I get back in work. Thanks. Sep 25 '14 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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