Is it possible to search Matrix columns directly with Low Search
I have a matrix field programs with columns program (playa) and program_year (text). Is there a way to target the matrix columns directly for searching?
Ideally, I'd like to end up searching for the following parameters:
programs:program=12345
programs:program_year=2011
category=category_id
Is this type of search possible with Low Search?
Thanks,
Keston
Replies
Low 18 Oct 2012 20:25
Hi Keston,
That's not possible at the moment, I'm afraid. The closest you can get is using the search:my_matrix_field="" parameter, as you would with a regular channel:entries tag. Make sure the Matrix columns are searchable if you do.
Visual 3 Apr 2013 14:23
Hi,
is this by any chance possible now?
Thanks
Low 3 Apr 2013 14:27
I'm afraid not. But have you seen Sift? http://devot-ee.com/add-ons/sift
Visual 3 Apr 2013 14:42
Would i be able to combine low search with sift or would that mean creating two separate forms?
perhaps it could be something silly I'm over looking
this is my case:
Some fields + Matrix: Column1 column2 Column3
The normal checkboxes from other fields I've done with low_options for the matrix i hard coded the checkboxes like so:
Column2 = radio buttons
<input type="radio" id="88" name="search:leder_product" value="88" {if '88' IN ({low_search_search:leder_product})} checked="checked" {/if} />
Column3 = checkboxes
<input type="checkbox" name="search:leder_product[]" value="08mm" {if '08mm' IN ({low_search_search:leder_product})} checked="checked" {/if} /> 08 mm
So if i search the Column2 checkboxes i no longer can search in column 2 and the other way around
Would there be a workaround?
I don't need to exclude any column as they are all unique values
Low 3 Apr 2013 14:45
Never used Sift, I just remembered it searches Matrix.
Column search for Matrix isn't supported, but it could be a separate extension to add support for it (like Low Search Tag).
Visual 3 Apr 2013 15:04
I've sended an e-mail to Sift developer if i can create one form for what i need.
I'll keep you informed in case others need the same solution.
Thanks for the help!
Joel Bradbury 3 Apr 2013 15:12
Actually Sift+Low Search (or Solspace's SuperSearch) was one of the things that was brought up during the original development.
I haven't looked into it deeply, but there's likely going to need to be some hoop jumping to get the two to talk neatly to each other.
@low - the low_search:results block is just a channel:entries loop right? Sift does the standard searching and specifies results using the fixed_order param and some other parts. If there were a hook in Low Search that'd let Sift modify the channel object before the entries() was called it'd be possible.
Later on it hooks up to the matrix_data_query hook too, but I'm guessing Low Search doesn't touch that.
Low 3 Apr 2013 15:17
@joel, you could use either the low_search_pre_search or low_search_post_search hook. For Solspace Tag support, I've used the former. See https://github.com/lodewijk/low_searc...