ElasticSearch on suitecrm 8

Good morning,

I am running onto issues to make ElasticSearch work.

config

SuiteCrm 8.3.0
Elasticsearch is on 7.17.11

I have tried to run the indexing from the command line in fist place and had the following errors for each modules .

“[index] [security_exception] action [indices:admin/auto_create] is unauthorized for user [maxtest] with roles [maxtest] on indices [notes], this action is granted by the index privileges [auto_configure,create_index,manage,all]”

This is because it should be “maxtest_notes” and not just “notes”.

I cannot figure out how to add the prefix to the indices.

I also set a scheduled Job to run the ElasticSearch full indexing and set my instance to debug mode.
(I redone the permissions, ran a quick repair and rebuild)

I then got the following on my logs

"Fri Jul 21 08:57:02 2023 [1967505][1][DEBUG] Creating new instance of hook class SuiteCRM\Search\ElasticSearch\ElasticSearchHooks without parameters

Fri Jul 21 08:57:02 2023 [1967505][1][WARN] Elasticsearch trying to re-indexing a bean but this module is blacklisted: SchedulersJobs"

I am a bit lost now on how I could make ES work.

1 Like

Anyone got an ideas ?

Hello,

Could you fix this? I´m having this same problem but cannot find were to “de-blacklist” modules so elasticsearch isn´t indexing.

Hi,
I managed to get it fixed on suite crm 7.13
I need to get back to testing it on SuiteCRM 8

Are you on Suite 8 ?

Yes I’m on suite 8, how did you fixed it? Or it´s just working ok in 7.13?

We made it work, as our SuiteCRM instance is on WHM so we needed a prefix to the index to be able to index it.
To get the prefix across we did few steps :

In the file /public_html/lib/Search/ElasticSearch/ElasticSearchIndexer.php we declared the public function
" public function setCustomIndex($customIndex, $moduleName)
{
$this->setIndex($customIndex);
return $this->getIndex() . ‘_’ . strtolower($moduleName);
}"

On the same file around line 137 we added the line 140 on the screenshot, replace prefix with the prefix you need

Same file / same thing around line 367

Same file / same thing around line 385

Same file / same thing around line 447

You will also need to edit the line 107 on the file public_html/lib/Search/ElasticSearch/ElasticSearchEngine.php

image

After that I could run the index via the CLI ( Had some small issues with the search not displaying everything I needed on some modules so I disabled it for the moment , need to get back to it )

Hopefully that will help you to make it work