Using Low Search with grid fields attached via a fluid
I have a channel which contains details of product series (e.g. plastic caps for use in engineering) - the channel includes a fluid field.
The fluid field links to a number of Grid fields.
Each product series comprises multiple SKUs each with differing sizes. The Grid fields hold dimension data for product SKUs, and each row begins with the SKU number. The different grids reflect that each product potentially has a different set of critical dimensions, but all products in a series have an SKU. An SKU will only ever appear in a grid field table linked to a specific product series page.
I am trying to set up Low Search to be able to return the product series page when someone searches for a specific SKU.
I have enabled "include in search" for the fluid field, for all the component grid fields and within the grid fields for the SKU field.
I have set up Low Search to do simple keyword searching, and defined a collection which is set to include the contents of the product series channel. I have given the fluid field a search weighting of 3.
When I search I can find elements that are contained within a product series' other channel fields, but I am unable to find any SKU codes.
I would be grateful for any guidance about how I can correct / fix / work around this issue.
EE 4.2.1. Low Search 6.0.1
can find nothing untoward in apache log or EE debug info - can post these if helpful but not sure there is anything to see.
Replies
Low 9 May 2018 14:48
Here are things to check:
In the DB, check the exp_channel_data_field_X (where X is the Fluid field ID), and its field_id_X (again the field ID) column. The searchable data (the SKU-code in your case) should be present in that column for entry_id Y (where Y is any given entry ID).
Then, in the exp_low_search_indexes table, look up any rows for entry_id Y, and check the index_text column. The data above should be present in that column.
Make any changes, save, and check the columns again. Did both columns update correctly?
I have yet to add a workaround for this quirk, which might be relevant here.
Gavin Lawrie 9 May 2018 15:26
I've had a look, and with the exception of a single entry the content of exp_channel_data_field_X (where X is 99 and fluid field) is empty.
Not sure what is different about the single entry appearing - it is legit entry but perhaps is unusual in that the product attribute table for that series only has a single SKU (BC-01). Here's an image of the entry.
The entry in Low Search indexes for the one entry appearing in fluid field appears to be complete, and contains the SKU.
And indeed you can search for BC-01 and find it.
However for other entries (the ones where the exp_channel_data_field_99 is blank) the SKU information is not appearing in the low-search index. Here is the table for the product series with entry_id 25, which has multiple rows in the grid:
and here is the equivalent entry from low search indexes:
No idea if any of that helps - the issue would appear to be getting the SKU codes into the index... and working out why one product did make it across and rest didn't.
Low 9 May 2018 18:10
If the searchable data isn't present in the exp_channel_data_field_X table, then it makes sense it's not in the LS indexes table either. In fact, you could even try the native search module and the entry will not show up in results even though it should. This means it's pointing more towards an issue with EE rather than LS.
In fact, I got confirmation just now from EllisLab that they're currently working on "fluid (and grid) search content quirks", so I'll need to wait what that brings.
Gavin Lawrie 9 May 2018 18:44
Thanks for the update. Helpful. Wonder what timescale EE quirks fixing runs to.
I think I'll patch up a work-around - I suspect I can get a SQL query to cough up which SKUs are in grids associated with a product series, and then cut / paste these into a plain text field attached to the product series channel. Won't be a long term solution but perhaps will get client to some comfort level.