Low Search No Results and Not Indexing
I'm having a very strange problem where Low Search is not showing results from my field and it seems like the field is not being indexed. I've made a video of the problem as I feel like that will be a lot more clear and easy to follow. As is ever the case with development, this is a high priority issue I'd like to get to the bottom of as soon as possible. Let me know how to proceed.
https://vimeo.com/252797194/c41d723545
Replies
Low 26 Jan 2018 07:31
Might have something to do with the field being a Bloqs type, which I haven't tested with.
Is this a fresh install of EE or a 3 -> 4 upgrade (ie. does the field_id_x column also exist in the exp_channel_data table)?
Do you have a copy of Bloqs you can send me to test with?
Low 26 Jan 2018 08:48
My guess now is that the Bloqs fieldtype class has a third_party_search_index method that returns an empty string. But I'd need to verify that.
TJ Draper 26 Jan 2018 15:36
It's possible it's because it's a Bloqs field. It's worked with Bloqs in the past on previous versions of EE.
This is a new build of EE 4, no legacy fields. The channel_data table has nothing in it.
I'm checking with Brian to make sure it's okay if I send you a copy of Bloqs. I can't imaging why it wouldn't be but I want to be a good citizen. Is the best way to get it to you by DM on Slack?
Low 26 Jan 2018 15:38
I prefer email: hi at gotolow dot com.
TJ Draper 26 Jan 2018 15:59
Permission from Brian received, email sent.
Low 26 Jan 2018 16:28
Okay, when LS gets the entry data to put in its index, using
... the field_id_x column for the Bloqs field is empty, even if there's (searchable) data in the field in the DB. Not sure why, but seeing LS is trying to be field-agnostic when building the index, this might be a Bloqs thing...
Low 26 Jan 2018 16:56
So, I manually added the field_id_x column to the exp_channel_data table and added dummy data to it. That does show up. It's looking like Bloqs doesn't take the new EE4 data structure into account when it comes to this particular issue.
Litzinger 26 Jan 2018 17:09
Low, when a Bloqs field is saved it uses EE's encode_multi_field() method to concat all the block's text fields into a single string, and then calling the following method to insert it into the proper native field (either exp_channel_data, or exp_channel_field_data_N) depending on EE version and when the field was created.
It sounds like TJ's data is correct... its a new exp_channel_field_data_N table and contains the concatenated block data. If that is the case then Bloqs put the data where it needs to be so EE's native models recognize it.
Low 26 Jan 2018 17:21
Hmm. When I get the entries to index, I limit the fields by the relevant ones only, for example:
(where 75 is Bloqs), I actually don't get that field back from EE.
When I remove the fields filter altogether, it is there, with the correct data.
TJ: to replicate, open up libraries/Low_search_index.php and comment out line #234 ($builder->fields($field);). Then it works.
But... why wouldn't I get those results back when I limit the builder to the given fields?
TJ Draper 26 Jan 2018 17:28
Yep. Commenting out that line fixes everything.
Low 26 Jan 2018 17:31
Now, is this a LS issue, or an EE issue? I'm telling the EE model to get that field, but it's not returning it. That doesn't sound right, does it?
TJ Draper 26 Jan 2018 17:32
It does seem suspect for sure.
Nick Bedard 8 Feb 2018 21:34
Did you ever get to the bottom of this? I have the exact same issue (every symptom the same) with a textarea field I just added to an EE 4.0.8 install. All other fields are searching fine but I've added this new field and the contents are not getting added to the index.
Low 9 Feb 2018 13:12
Just filed this bug report.
A workaround for now: open up libraries/Low_search_index.php and look up line #192, which reads:
Change that to...
...so 2 lines. Not sure if I should add that to the core, as it's a workaround for what seems to be an EE bug.
Low 12 Feb 2018 08:56
EllisLab are not labeling it a bug as such, so I've added the workaround to LS in v6.0.1.
4thPixel 19 Feb 2018 23:29
we are also experiencing an issue with EE3.5.12, LS 5.2.1, Bloq 3.3.4 and Publisher 2.7.5 .
Our bloqs are not being indexed at all. We made sure the atoms are searchable and that the main field type is searchable as well. We set the slider to 3 in LS, resaved our entries and rebuilt our index. Nothing!
Any ideas? Could this also be the same issue?
4thPixel 21 Feb 2018 16:28
Hi Low, Just wondering if you were able to go and check it out. This is now a live server so I'm going to block your access.