0

I need to implement the following search on my ee site

I have a matrix field with the following columns

start date
end date

For example, I have an entry with 2 rows in my matrix column where the values listed are dates that are not available

Entry Title: Entry 1
Matrix values
Start Date   -  End Date
01/01/2014 - 15/01/2014
01/02/2014 - 20/02/2014

On my search form I have a search form with start date and end date

The user searches with the the following details
Start Date   -  End Date
02/01/2014 - 10/01/2014

When the users searches no results are displayed as the dates the user selected are in the matrix field as not available

The user searches with the the following details
Start Date   -  End Date
16/01/2014 - 20/01/2014

Entry 1 is returned as the dates selected are not in the unavailable list for that entry

Is this possible with low search and is there an example?
Thanks

1

First of all, Matrix data columns need to be set to "searchable" for its data to be stored, as a concatenated string, in exp_channel_data. Once that is set up, searching in this Matrix field using Super Search is limited since Super Search will only look for a string match between your search and what is stored in exp_channel_data. In other words, there are no date-based calculations being made. Further, for date columns, it might be possible that this data is saved as a unix timestamp, so you would have to make your search match an exact unix timestamp stored in exp_channel_data.

| improve this answer | |
  • Hi Thanks I have a custom import for my data and I an importing the the matrix data into table exp_matrix_data So if I have the matrix columns set as searchable will the entry in exp_channel_data be automatically created/entered? Or is there a way to manage this? – Macker999 Apr 28 '14 at 8:30
  • For your searchable data to end up in exp_channel_data, you will need to re-save every entry using your Matrix custom field. Matrix saves to exp_channel_data on entry save. – Solspace Apr 28 '14 at 8:52
  • Thanks If I used your imported extension would I have still re-save every entry that was imported? – Macker999 Apr 28 '14 at 13:30
  • Yes. By the way, the above answer is really saying that searching for dates within a Matrix field isn't really easily possible. Super Search doesn't see the data as "date" data in exp_channel_data. – Solspace Apr 28 '14 at 13:55

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.