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"
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
You will also need to edit the line 107 on the file public_html/lib/Search/ElasticSearch/ElasticSearchEngine.php
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 )