0

Hi Was wondering if anyone can help me?

I have purchased Low Search and im stuck.

Basically the ultimate goal is to have a channel called franchise with say 200 different franchises/entries, with a textarea field in each filled with different postcodes seperated by a comma in each entry.

for example one entry would be:

Title: Conwy

Postcodes: ll21, ll22, ll23, ll24, ll25

At somepoint i may need to have a postcode more indepth for sameple ll21 5bd.

These are the postcodes that, that franchise covers.

I want to have the search only search the channel "franchise" and only searches the "postcode" field.

For the results i just want to go straight to the relevant entry.

Honeslty i really appreicate any help. Because i am so stuck.

Thanks,

Wes.

Hi Low,

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

Then the results tag was the bog standard one on the docs.

{exp:low_search:results query="{segment_3}" limit="10"}
{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}

Sorry for being so Vague, i am just unsure how to go about this, thanks for help.

These are the postcodes in the entry for conwy in the postcodes_covered field:

LL16,LL18,LL21,LL22,LL24,LL25,LL26,LL27,LL28,LL29,LL30,LL31,LL32,LL33,LL34,LL57

So the idea is that if someone searched for ll26 5he it would return the conwy entry.

Cheers.

2
  • Can you share at least some code you have now? You probably should be looking at either the Keywords filter or the Field Search filter. – Low Sep 5 '14 at 6:47
  • Hi Low, i have added to the bottom of the question thanks for help. – Third_Hyperion Sep 5 '14 at 8:23
1

Although it's not clear from your question exactly how you're stuck, there are a couple of things you can check.

  • Using search:postcodes_covered in your opening Form tag does nothing. You can remove it.
  • You're using <input name="keywords" ... >, which means you're using the Keywords filter, for which you need to set up at least one Collection.
  • When setting up the collection, make sure your postcode field has an assigned weight of 1 or up. Setting it to 0 will exclude it from the index, thus making it not searchable.

You can also consider using the Field Search filter. So instead of using <input name="keywords">, you'd have to use <input name="search:my_postcode_field">.

As for the Results tag: remember that it extends the channel:entries tag. So if no entries show up, that might also be due to a status not being given or the entry/expired dates.

Pro Tip: enable template debugging to see what the add-on is doing. This will help debugging, too.

2
  • Cheers low, Is it possible to use the "search:field_name:column_name" with matrix but make use of two columns in the search instead of just one. search:field_name:column_name_one:column_name_two Is there a way to take the first column of say "ll28" but then take the second column of "1" or "2" etc.. A user would search the <input> for a post code of example "ll28 5he" So take "ll28" which would be in column one, and then the second column of sector of "5" and then ignore whatever the user types after that "he" – Third_Hyperion Sep 6 '14 at 11:47
  • I guess this is a different question, really. The syntax you mention isn't possible. You can only target a single column per parameter like that. But you can have multiple parameters. – Low Sep 7 '14 at 10:03

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.