All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Low Search No Results and Not Indexing

TJ Draper 25 Jan 2018 23:06 question, complete

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

  1. 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?

  2. 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.

  3. 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?

  4. Low 26 Jan 2018 15:38

    I prefer email: hi at gotolow dot com.

  5. TJ Draper 26 Jan 2018 15:59

    Permission from Brian received, email sent.

  6. Low 26 Jan 2018 16:28

    Okay, when LS gets the entry data to put in its index, using

    ee('Model')->get('ChannelEntry') ...


    ... 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...

  7. 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.

  8. 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.

     
    public function updateFieldData($siteId, $entryId, $fieldId, $data)
    {
    $ee = $this->EE;

    $updates = array(
    'field_id_' . $fieldId => $data
    );

    // -------------------------------------------
    // 'blocks_update_field_data' hook
    //
    if ($ee->extensions->active_hook('blocks_update_field_data')) {
    $ee->extensions->call('blocks_update_field_data', $siteId, $entryId, $fieldId, $data);
    } else {
    /** @var \EllisLab\ExpressionEngine\Service\Database\Query $db */
    $db = $ee->db;

    foreach ($updates as $fieldName => $updateData) {
    $tableName = AppHelper::getFieldTableName($fieldName);

    $db
    ->where('entry_id', $entryId)
    ->update($tableName, [
    $fieldName => $updateData,
    ]);
    }
    }
    //
    // -------------------------------------------
    }


    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.

  9. 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:

    Array 
    (
    [0] => entry_id
    [1] => title
    [2] => field_id_1
    [3] => field_id_2
    [4] => field_id_75
    )


    (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?

  10. TJ Draper 26 Jan 2018 17:28

    Yep. Commenting out that line fixes everything.

  11. 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?

  12. TJ Draper 26 Jan 2018 17:32

    It does seem suspect for sure.

  13. 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.

  14. 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:

    $select[] = 'entry_id';


    Change that to...

    $select[] = 'entry_id'; 
    $select[] = 'channel_id';


    ...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.

  15. 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.

  16. 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?

    Low 20 Feb 2018 11:34

    Not likely; EE4 moved to a different DB scheme, and LS 6 uses EE's models to take that into account. That's what caused this issue. EE3 and LS 5 still use the old scheme and methods, so it's probably a different issue. Maybe re-save the entries if you only made the Bloqs field (and atoms) searchable after content was already entered?

    4thPixel 20 Feb 2018 12:05

    We tried that and it still not finding it in the search. Should I not see that in the low_search_indexes table?

    Low 20 Feb 2018 12:21

    I'll need to take a look myself. Please send SuperAdmin login credentials to hi at gotolow dot com if you can.

    4thPixel 20 Feb 2018 15:06

    I provided you with the accesses! Thx

  17. 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.

    Low 21 Feb 2018 17:49

    I just looked for your email; it was marked as spam so didn't notice it till now. Therefore haven't been able to look yet.

    4thPixel 3 Apr 2018 22:50

    Hi Low. Any news on this? We are still not able to pull searches of content within a bloq field.

    Low 4 Apr 2018 06:04

    The login creds weren't working, so I assumed you blocked the access. If you want me to take a look still, please re-send me the login creds.