ElasticSearch Essentials

ElasticSearch Essentials [Paid] 3.15.12

No permission to buy ($30.00)
I tend to wait a little longer on upgrades and we have just upgraded from 1.5 to 2.1. I am having lots of problems with Elastic Search Essentials. We went live with the upgrade 2 days ago and I installed XFMG and XFES just before the go live. I then installed all the 3rd party addons we had been testing including both Elastic Search Essentials and Search improvements. When I look at the Elastic Searc options I see a series of type descriptions with error remarks. i.e.

xfmg_media​

title Expected, text
message Expected, text
date Expected, stored, long
user Expected, stored, long
discussion_id Expected, stored, long
hidden Expected, boolean
tag Expected, long
mediacat Expected, long
mediaalbum Expected, long

This a copy and paste of the red text shown in my AdminCP. I think I need to understand something that I have clerly omitted. There may have been a problem with the order of addon upgrades. Sorry abouot the lost formatting.

Is there somewhere I can look for insight on how to set these content type values.
 
There should be an "Optimization required" with a button next to it above the ElasticSearch type mappings box. Click that, and then do a full-reindex.

Without those attributes, search may not work 100% as expected at times.
 
When I click on the button next to the optimization required message, I get an error display. There is no suggestion on how to proceed.

XFES\Elasticsearch\RequestException: mapper [content_id] cannot be changed from type [long] to [text] in src/addons/XFES/Elasticsearch/Api.php at line 409
  1. XFES\Elasticsearch\Api->request() in src/addons/XFES/Elasticsearch/Api.php at line 305
  2. XFES\Elasticsearch\Api->createIndex() in src/addons/XFES/Service/Optimizer.php at line 85
  3. XFES\Service\Optimizer->optimize() in src/addons/XFES/Admin/Controller/EnhancedSearch.php at line 151
  4. XFES\Admin\Controller\EnhancedSearch->actionOptimize() in src/XF/Mvc/Dispatcher.php at line 350
  5. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
  6. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  7. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  8. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2191
  9. XF\App->run() in src/XF.php at line 391
  10. XF::runApp() in admin.php at line 13

This appeared in the system error log at the same time.

Server error log
  • ErrorException: {"sort":[{"date":"desc"}],"docvalue_fields":["discussion_id","user","date"],"_source":false,"size":"200","query":{"bool":{"filter":[{"term":{"user":14598}},{"type":{"value":"thread"}}],"must_not":[{"exists":{"field":"hidden"}}]}}}
  • src/XF/Error.php:75
  • Generated by: Unknown account
  • Nov 5, 2020 at 9:04 PM

Stack trace​

#0 src/XF.php(184): XF\Error->logError('{"sort":[{"date...', false)
#1 src/addons/SV/SearchImprovements/XFES/Elasticsearch/Api.php(19): XF::logError('{"sort":[{"date...')
#2 src/addons/XFES/Search/Source/Elasticsearch.php(153): SV\SearchImprovements\XFES\Elasticsearch\Api->search(Array)
#3 src/XF/Search/Search.php(175): XFES\Search\Source\Elasticsearch->search(Object(SV\SearchImprovements\XF\Search\Query\Query), '200')
#4 src/XF/Repository/Search.php(34): XF\Search\Search->search(Object(SV\SearchImprovements\XF\Search\Query\Query))
#5 src/XF/Pub/Controller/Search.php(402): XF\Repository\Search->runSearch(Object(SV\SearchImprovements\XF\Search\Query\Query), Array, false)
#6 src/XF/Pub/Controller/Search.php(248): XF\Pub\Controller\Search->runSearch(Object(SV\SearchImprovements\XF\Search\Query\Query), Array, false)
#7 src/XF/Mvc/Dispatcher.php(350): XF\Pub\Controller\Search->actionMember(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Search', 'Member', Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\Search), NULL)
#9 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\Search), NULL)
#10 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(2191): XF\Mvc\Dispatcher->run()
#12 src/XF.php(391): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}

Request state​

array(4) {
["url"] => string(43) "/search/member?user_id=14598&content=thread"
["referrer"] => bool(false)
["_GET"] => array(2) {
["user_id"] => string(5) "14598"
["content"] => string(6) "thread"
}
["_POST"] => array(0) {
}
}

[/quote]
 
When I click on the button next to the optimization required message, I get an error display. There is no suggestion on how to proceed.
You need to blow away the entire index and start again. Wish there was a better way.

This appeared in the system error log at the same time.
This looks like Search Improvement's "Log Search DSL" option is enabled, you probably should disable it as it is only for troubleshooting.
 
Just to be sure I understand, do I need to use cli to drop the index? Or is there an option here that does what you suggest?

I do not see an explicit "drop the index" option. The optimize button warns that it will do that, but it generates the error message if I click to accept that.
 
You need to blow away the entire index and start again. Wish there was a better way.

I'm not aware of this addon/XFES or what the "Optimization required" button does behind the scenes?

But from my past experience managing ES, a better way would be to
1. Create a new index with the correct mapping.
2. Copy over the content using reindex; this is usually fast as there is no network latency between MySQL and ES as it directly copies data from one index to other. There is no need to even throttle on a server (assuming you host ES on a different server than the main website).
3. Use alias to switch the index instantly to the new ES.

Just to be sure I understand, do I need to use cli to drop the index? Or is there an option here that does what you suggest?
Simple curl request to delete the index. ES Docs explain how to create the curl request: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html
 
Last edited:
XFES is the XenForo interface to Elastic Search. @Xon has created some addons that extend the search syntax of the XenForo Extended Search.

Unfortunately a simple Curl request is a high bar for me. That is next months learning as I start to implement some api based apps.

I have a very busy live system that has started falling apart with system errors. At the moment we have Elastic Searc installed on the same processor as XenForo. When I installed it 3 years ago on our cPanel/WHM in-house system. I used a SSH session to do the install since there is no support for it directly in cPanel.
 
You can safely ignore those elasticsearch type mapping warnings (for now). I'm surprised the optimize button didn't work, that is probably an XFES bug.
 
I'm not aware of this addon/XFES or what the "Optimization required" button does behind the scenes?
It setups expected type mappings, it should delete the index and then re-create it.

XenForo doesn't push in the _source document (which saves a lot of space) so that reindex feature doesn't work
 
We had a cascade of events that started with multiple warnings that our MariaDB version was out of date with loss of support. I updated the MariaDB and thought all was OK. However, our system had a fatal crash about 5 days later and another admin installed PHP 7.3 which seemed to be needed to support MariaDB.

I see now in my system configuration in adminCP that Imagick and Suhosin have been disabled/removed.

I had decided that the system errors I was seeing were due to the error reporting level being left with strict and deprecated. I need to read a bit more on WHM to be able to fix that (or roll back to 7.1 maybe).

However, the removal of Imagick would also have broken my @AndyB addons for image tweaking.

I fell like I am painting myself into a corner. Any suggestions would be very welcome.
 
Any update on the availability of the 2.2-compatible version of ESE?
It is in the work-queue, I'm just finishing off XF2.2 compatible versions of Alert Improvements and User Essentials.

We had a cascade of events that started with multiple warnings that our MariaDB version was out of date with loss of support. I updated the MariaDB and thought all was OK. However, our system had a fatal crash about 5 days later and another admin installed PHP 7.3 which seemed to be needed to support MariaDB.

I see now in my system configuration in adminCP that Imagick and Suhosin have been disabled/removed.

I had decided that the system errors I was seeing were due to the error reporting level being left with strict and deprecated. I need to read a bit more on WHM to be able to fix that (or roll back to 7.1 maybe).

However, the removal of Imagick would also have broken my @AndyB addons for image tweaking.

I fell like I am painting myself into a corner. Any suggestions would be very welcome.
You need php 7.3+ to be compatible with latest MariaDB (they plan to release a bugfix, no idea when) downgrading Mariadb is quite painful. And it should be a relatively simple matter to enable Imagick again. Suhosin is a waste of time with XenForo for the most part.

I can't offer too much in sysadmin support sadly
 
Top Bottom