Advanced search setup
I'm hoping that Low Search can accomplish the following features.
I have a channel for modular homes. Each entry has attributes that I need to have the ability to search and sort on things such as
# Bedrooms
# Bathroom
Price range
Geo Region
Manufacturer (which is a relationship to the list of Manufacturers)
Is this something that is doable with Low Search?
If so, can you give me a head start on how you'd go about doing that?
Here's an image of the UI that we are working on too.
Replies
Low 24 Apr 2012 07:44
Hi Tod,
The only thing not possible at the moment is filtering results by relationship fields (like the native relationship field or Playa).
The rest should be possible using form fields like <select name="search:number_of_bedrooms"> if Bedrooms is a channel field called number_of_bedrooms and <select name="category"> for Regions, if you're storing them in Categories.
Ranges should be possible as well, as long as the field type is numeric and you're passing the values as explained in the docs.
Todd Moffett 12 Jun 2012 15:14
Hi,
Still in the process of wrapping my head around this module.
Should I create collections for selects? (bedrooms, bathrooms, sections, price)
Could you give me an example of what the code setup would be for those for variables? I'm planning on making them radio selects.
Low 12 Jun 2012 18:41
I reckon you need only 1 collection: the one holding the Homes channel. The collection's index will be used for keyword searches. For other filters, create Select fields or Radio fields (or 3rd party fields like Pixel & Tonic's Pill).
For example, you can create such a field for the Bedrooms. The field then would contain either "1", "2", "3" or "4+". In the search form, you can add a select-element with name="search:my_bedrooms_field" and options with the same values. Submitting that will be the same as adding a search:my_bedrooms_field="3" to a channel:entries tag, for example.
Does that help?
Todd Moffett 13 Jun 2012 00:50
Yeah I think that helps. I'll tear into it a bit and see.
Thanks again.
Todd Moffett 13 Jun 2012 02:18
It seems to be working to a point. I can get results but, I'm only getting an equal or greater return. For example, if I do a search for 3 bedrooms the results are for anything with 3 or more bedrooms.
Is there any chance I can send you a private link for clarity?
Low 13 Jun 2012 08:04
Sure. If you want me to take a look, send superadmin login credentials to hi at gotolow dot com.
Todd Moffett 29 Jun 2012 05:36
Do you have any insight for searching price ranges? Do I need to have commas and dollar symbols in the search range?
Low 29 Jun 2012 09:30
Yeah, use the native Text Input field, and choose "Decimal" for Field Content. That probably uses just a period for decimal separator and you can leave out the dollar symbol.
Todd Moffett 29 Jun 2012 15:27
Decimal doesn't actually work. I'm dealing with large numbers ($120,000-$356,000).
I've tried creating a cheat for the output by eliminating the comma separation on input. Then I just do a search range like this.
For some reason though my search fails on anything from "75" through "99 and up"
Thoughts?
Low 1 Jul 2012 11:30
What is the Field Content setting of that field? Number, Integer or Decimal should work in your setup.
If the Field Content is 'Anything', then it's considered text, and a value of 75 will be considered higher than 100 (starting with a 7 vs. a 1).
Todd Moffett 24 Sep 2012 18:14
After updating to 2.1 I'm getting internal server errors when searching by region and manufacturer. Your login is still active if you get a chance, can you take a look at this?