EE compatibility updates:

  • Publisher is EE5 compatible, but it does not currently support the Fluid field.

ExpressionEngine.com licenses:

  • If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Low Search results not show if We have 2 bloq field.

Status Resolved
Add-on / Version Bloqs 4.2.3
Severity
EE Version 5.3.2

Andrew Jones

Aug 27, 2020

We have EE 5.3.2 with these modules:

Bloqs                         4.2.3
Low Search                       6.2.1
Publisher                         3.1.5
Publisher - Low Search Support 3.0.1
Structure                         4.6.1

We have PAGES channel, where we are using 2 bloq fields. One is for main content and another one is for sidebar. If we have sidebar bloq field empty, search results work with keywords from main content bloq field. But if we have just 1 block added in sidebar bloq field, It not return search result with search term from main content field.

#1

Andrew Jones

Sep 01, 2020

Hi Guys,

Any chance of some help with this issue, please? We have a site nearly ready to go live and the only roadblock left is this low search/bloqs issue?

thanks
Neil

#2

BoldMinded (Brian)

Sep 01, 2020

Sorry for the delay, been busy. I’ll try to take a look at it soon.

#3

BoldMinded (Brian)

Sep 01, 2020

What other add-ons do you have installed?

#4

Andrew Jones

Sep 01, 2020

https://prnt.sc/u9j3bh Here is the list of all addons we use in that site

#5

BoldMinded (Brian)

Sep 01, 2020

In the PublishController.php, line 646 you’ll see this:

if (count($searchValues) > 0) {

Replace it with this:

if (!empty($searchValues)) {
            // Grab existing search values if multiple Bloqs fields are being saved at the same time.
            $prevSearchValues = $this->EE->session->cache('bloqs', 'searchValues');

            if ($prevSearchValues) {
                $searchValues = array_merge(explode('|', $prevSearchValues['fieldValue']), $searchValues);
            }

The whole conditional should end up looking like this:

if (!empty($searchValues)) {
            // Grab existing search values if multiple Bloqs fields are being saved at the same time.
            $prevSearchValues = $this->EE->session->cache('bloqs', 'searchValues');

            if ($prevSearchValues) {
                $searchValues = array_merge(explode('|', $prevSearchValues['fieldValue']), $searchValues);
            }

            // Handled in ext by after_channel_entry_update()
            $this->EE->session->set_cache('bloqs', 'searchValues', [
                'entryId' => $entryId,
                'fieldId' => $this->_fieldId,
                'fieldValue' => encode_multi_field($searchValues)
            ]);
        }

 

#6

Andrew Jones

Sep 01, 2020

In `bloqs/libraries/EEBlocks/Controller/PublishController.php` file, I have changed code from:

if (count($searchValues) > 0) {
    // Handled in ext by after_channel_entry_update()
    $this->EE->session->set_cache('bloqs', 'searchValues', [
        'entryId' => $entryId,
        'fieldId' => $this->_fieldId,
        'fieldValue' => encode_multi_field($searchValues)
    ]);
}

to:

if (!empty($searchValues)) {
    // Grab existing search values if multiple Bloqs fields are being saved at the same time.
    $prevSearchValues = $this->EE->session->cache('bloqs', 'searchValues');

    if ($prevSearchValues) {
        $searchValues = array_merge(explode('|', $prevSearchValues['fieldValue']), $searchValues);
    }

    // Handled in ext by after_channel_entry_update()
    $this->EE->session->set_cache('bloqs', 'searchValues', [
        'entryId' => $entryId,
        'fieldId' => $this->_fieldId,
        'fieldValue' => encode_multi_field($searchValues)
    ]);
}

and then open the entry and resave it. but it still not search the terms from 1st bloq field. before and after data under low search index table is also the same.

#7

BoldMinded (Brian)

Sep 01, 2020

Ok, so this isn’t a Bloqs issue. It’s most likely Publisher related. You can undo that previous code change. After looking at it closer in my environment is sort of works, but isn’t a correct change to make.

#8

BoldMinded (Brian)

Sep 01, 2020

When you look at your exp_low_search_indexes table do you see all the text in the expected row? Locally this appears to be working fine for me. All the searchable text from 3 blocks (the Products block is not searchable) appear in the search index.


#9

Andrew Jones

Sep 01, 2020

Works now. The new issue is, If I set any one of the current 3 bloq field to not searchable, search just not works for bloqs at all.

So I have to mark searchable to all 3 bloq field I am using.

Login to reply

For add-on support, please use the Support section. General inquries and pre-sale questions can be sent to support@boldminded.com.