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

Support archive

Search for Membership Directory

Todd Richards 17 Sep 2014 02:29 problem, complete

I’ve got a site with a membership directory with a simple search form that will let you search for a firm or a member. The search form let’s you search by keywords

and/or by the US state they are located in

Please select....
Alabama
Alaska
Arizona
Arkansas
...
Wisconsin
Wyoming

NOTE: The state is in a VZ Address field inside a Matrix field. It is referred to as "region" within the VZ Address field.

The opening of the search form is below, and the collection includes both the firms and zoo visitor channels
{exp:low_search:form collection="firms|zoo_visitor" result_page="directory/search" loose_ends="both" show_future_entries="yes”}

The opening for the results page is as follows:
{exp:low_search:results query="{segment_3}" collection="firms|zoo_visitor" status="not closed" limit="10" disable="member_data" paginate="bottom" show_future_entries="yes" orderby="title" sort="sac"}

THE GOAL
The goal would be that someone can search for “Smith” and find all of the hits that include Smith. If they add the state of Florida (FL), it would narrow those results to just the “Smith” people from Florida. If they only searched for Florida (FL), it would provide the results of only those firms in Florida.

THE PROBLEM
The keyword search seems to be working very well. I thought the state search was too. However, additional testing says otherwise. For instance, a search for Arizona (AZ) provides one result for a person from New York (NY). A search for Florida (FL) provides 8 hits, with one of them being NY. A search for Alaska (AK) provides one hit from Florida.

I checked the results to see if there was something in the firms or individual profiles that would match the state (i.e. FL, AZ, AK). And I don’t find anything.

I’m fairly new to Low Search, so I’m guessing there is something that I’m missing that is allowing the blurry results. The live site can be seen at hcaa.com/directory

Thanks for any help you can offer!

Replies

  1. Low 17 Sep 2014 08:27

    First off, you've got filter parameters in the Form tag (collection, loose_ends, show_future_entries), which do nothing. You can safely remove them.

    The Field Search targeting the Matrix column works just like the native search:field parameter. Its workings also depend on how the VZ Address field stores its data; which I presume is in a JSON format, but I'm not 100% sure about that.

    By default, the field search performs a substring search, so selecting Florida will search for "FL", so any entry that has the substring "FL" in that column will be returned. The New York entry you mentioned has the word "Floor" in it, which is why it is returned.

    You might want to look at the \W matching to search only for the word "FL", not the substring.

    Even better (for searching purposes, anyway) would be a dedicated field for storing the state, so you can use exact matching (eg. "=FL").

  2. Todd Richards 14 Jan 2015 01:29

    Hi Low - I'm sorry that I didn't reply to this until now. I was going through email and saw your response, and realized I never followed up again. :(

    I ended up adding another column in Matrix for "State", then searching by that. Easy to implement and it works perfectly!

    Thanks again for your response on this. And sorry I'm so late!!!