Matrix data not appearing in Low Search results
Hi Low,
I've noticed that I'm not getting results from a Matrix field in my Low Search results. The Matrix field is searchable and is included in the collection, and the Matrix columns themselves are all searchable.
If I search for the entry title, I can see them in the search results. But if I search for a phrase that's contained in the Matrix field data, I get no results.
Any ideas what's going wrong here? I'm using EE 2.8.1, Low Search 3.1.5, and Matrix 2.5.10.
Thanks,
Stephen
Replies
Low 21 May 2014 17:20
Can you share your Form and Results code? You can use http://pastie.org/ or http://pastebin.com/ for large chunks of code.
Also, what's the URI for a search that should return an entry with Matrix, but doesn't?
For such an entry, you can also look up what is actually in the search index, by looking that entry_id in the exp_low_search_indexes table. What does that tell you?
Stephen 22 May 2014 13:13
Hi Low,
I checked the exp_low_search_indexes table and could see that all the data from the entry was missing, other than the title.
I've been playing around with this further and creating test entries, and I think I've got to the bottom of what's causing the issue.
I always enable Entry Versioning for a channel, and I click the Save Revision button so that I can save an entry and stay on the same page (which feels like a nicer workflow to me). But it seems that when you press Save Revision, the entry isn't being automatically indexed in the exp_low_search_indexes table.
Strangely, I found that rebuilding the collection didn't always fix the issue (it did on a small test entry, but didn't on a larger entry with lots of Matrix data within it).
So the only way I could fix the issue was to press the Submit button for that entry, instead of the Save Revision button, and the exp_low_search_indexes table then populated with all the custom field data for that entry as expected.
Does this sound like a bug to you? Or do you need any more information?
Thanks,
Stephen
Low 22 May 2014 14:09
I can see the behaviour, and I agree it's strange, but it's not something I can change. Hitting 'Save Revision' doesn't trigger the 'entry_submission_end' hook which LS uses to keep the index up-to-date. On top of that, I cannot use earlier hooks, because then the entry_id isn't available for new entries.
You'll either just have to hit 'Submit' instead and use something like this add-on to have you redirect to the entry again, or bug EllisLab to trigger the 'entry_submission_end' hook when a revision is saved.
Stephen 27 May 2014 13:12
Hi Low,
I've came across this issue before with CE Cache. I reported it as a bug in the EE bug tracker: https://support.ellislab.com/bugs/det...
If you have any comments on this, it'd be great if you could add them there so Robin can review them and take them into account.
Thanks,
Stephen