ElasticSearch Essentials

ElasticSearch Essentials [Paid] 3.15.12

No permission to buy ($30.00)
This add-on doesn't touch synonym support, while elasticsearch does support synonyms with some additional work but I've never nailed down how you load a pre-defined list of synonyms into it without handcrafting it.
If it's something that intrigues you enough to take a look I can sponsor a few hours of coffee break time. :D
 
Hello,

I have installed the latest version on a customer's website but the autocomplete in the search bar links aren't working.
It worked fine prior to the upgrade.

Nothing happens when clicking on the links.

Clément
 
This add-on doesn't touch synonym support, while elasticsearch does support synonyms with some additional work but I've never nailed down how you load a pre-defined list of synonyms into it without handcrafting it.
I think it might be done via an ES plugin. It would be handy to have that for certain terms in the database and yes, being niche-specific, I would fully expect to have to create my own synonym list.

I don't think the stemming analyzer does it, where color = colour, etc. (I mean, I can't help it if Canadians spell everything wrong. 😁) In a sense, it is a variation on the same word.

I have long wanted support for phonetic searching. With many forum members having bad spelling, it's often a source of frustration when they claim our search engine sucks when they can't even spell their search terms correctly. That is an ES plugin and one of these days, I may mess around with it on one of my servers to see how it works. I can't think of any other forum system that has phonetic search baked in.
 
Hello,

I have installed the latest version on a customer's website but the autocomplete in the search bar links aren't working.
It worked fine prior to the upgrade.

Nothing happens when clicking on the links.

Clément
Check if the search index is requiring optimization, and if there are any elasticsearch related errors.

Without knowing the exact old version, it is hard to tell what changed that could have caused this.
 
Check if the search index is requiring optimization, and if there are any elasticsearch related errors.

Without knowing the exact old version, it is hard to tell what changed that could have caused this.
The search index does not require optimization.

Where would I go looking if there are any elastic search related error ? In Xenforo’s error log ?

I don’t recall the exact version that was ran before unfortunately.

Is there any action I could try ? Like purging index maybe ?
 
Where would I go looking if there are any elastic search related error ? In Xenforo’s error log ?
Yes, basically if there are any errors related to search it might hint on what went wrong.

Is there any action I could try ? Like purging index maybe ?
Purging the index and re-indexing is what I'ld recommend. You can use the CLI indexer to use multiple threads which can be significantly faster than the web UI re-indexing.
 
It didn't help.

The search itself works, it's just clicking on the returned item in the dropdown that doesn't work.
Nothing happens on click.
 
The search itself works, it's just clicking on the returned item in the dropdown that doesn't work.
Nothing happens on click.
So the autocomplete search is popping up but the links aren't clickable? Wat. The front-end javascript hasn't changed in quite some time.

Can you open a ticket on my site for further troubleshooting?
 
Hi @Xon,

Any idea what this error means?

XFES\Elasticsearch\RequestException: Elasticsearch error: [XXXcpanel][127.0.0.1:9300][indices:data/read/search[phase/query]] DSL:{"sort":["_score",{"date":"desc"}],"docvalue_fields":["discussion_id","user","date"],"_source":false,"size":10,"query":{"bool":{"filter":[{"term":{"type":"thread"}},{"term":{"node":8}}],"must_not":[{"exists":{"field":"hidden"}},{"term":{"thread":20036}}],"must":[{"function_score":{"query":{"multi_match":{"type":"most_fields","query":"\u05e8\u05de\u05e7\u05d5\u05dc\u05d9\u05dd\/\u05d0\u05d5\u05d6\u05e0\u05d9\u05d5\u05ea \u05dc\u05de\u05d7\u05e9\u05d1","operator":"or","fields":["title","elasticess_title","title.exact^1.5"]}},"functions":[{"exp":{"date":{"origin":1697577328,"decay":0.5,"scale":31536000}}},{"filter":{"term":{"node":8}},"weight":1.5}]}}]}}}
src/addons/XFES/Elasticsearch/Api.php:424

and:
ErrorException: {"sort":["_score",{"date":"desc"}],"docvalue_fields":["discussion_id","user","date"],"_source":false,"size":10,"query":{"bool":{"filter":[{"term":{"type":"thread"}},{"term":{"node":3}}],"must_not":[{"exists":{"field":"hidden"}},{"term":{"thread":54582}}],"must":[{"function_score":{"query":{"multi_match":{"type":"most_fields","query":"\u05e1\u05d5\u05db\u05e8 \u05e2\u05e0\u05d1\u05d9\u05dd","operator":"or","fields":["title","elasticess_title","title.exact^1.5"]}},"functions":[{"exp":{"date":{"origin":1697715589,"decay":0.5,"scale":31536000}}},{"filter":{"term":{"node":3}},"weight":1.5}]}}]}}}
src/XF/Error.php:77



Thanks
 
Last edited:
I would need to see the stack trace and the complete error message.

The first one is likely from "On error, log search DSL", but elasticsearch should have given a better message than that but the 2nd one is probably from "Log search DSL" being enabled. Make sure "Log search DSL" is disabled, it is only useful for troubleshooting purposes.
 
I would need to see the stack trace and the complete error message.

The first one is likely from "On error, log search DSL", but elasticsearch should have given a better message than that but the 2nd one is probably from "Log search DSL" being enabled. Make sure "Log search DSL" is disabled, it is only useful for troubleshooting purposes.
Thanks, here is the Full error:

XFES\Elasticsearch\RequestException:Elasticsearch error: [cpanel][127.0.0.1:9300][indices:data/read/search[phase/query]] DSL:{"sort":["_score",{"date":"desc"}],"docvalue_fields":["discussion_id","user","date"],"_source":false,"size":10,"query":{"bool":{"filter":[{"term":{"type":"thread"}},{"term":{"node":8}}],"must_not":[{"exists":{"field":"hidden"}},{"term":{"thread":20036}}],"must":[{"function_score":{"query":{"multi_match":{"type":"most_fields","query":"\u05e8\u05de\u05e7\u05d5\u05dc\u05d9\u05dd\/\u05d0\u05d5\u05d6\u05e0\u05d9\u05d5\u05ea \u05dc\u05de\u05d7\u05e9\u05d1","operator":"or","fields":["title","elasticess_title","title.exact^1.5"]}},"functions":[{"exp":{"date":{"origin":1697577328,"decay":0.5,"scale":31536000}}},{"filter":{"term":{"node":8}},"weight":1.5}]}}]}}}
src/addons/XFES/Elasticsearch/Api.php:424
Generated by: Unknown account
18/10/23 at 00:15

Stack trace​

#0 src/addons/XFES/Elasticsearch/Api.php(338): XFES\Elasticsearch\Api->request('get', 'xflive/_search', '{
"sort": [...')
#1 src/addons/XFES/Elasticsearch/Api.php(236): XFES\Elasticsearch\Api->requestFromIndex('get', '_search', Array)
#2 src/addons/SV/SearchImprovements/XFES/Elasticsearch/Api.php(56): XFES\Elasticsearch\Api->search(Array)
#3 src/addons/XFES/Search/Source/Elasticsearch.php(750): SV\SearchImprovements\XFES\Elasticsearch\Api->search(Array)
#4 src/addons/SV/SearchImprovements/XFES/Search/Source/Elasticsearch.php(298): XFES\Search\Source\Elasticsearch->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array, 10)
#5 src/addons/XFES/Search/Source/Elasticsearch.php(146): SV\SearchImprovements\XFES\Search\Source\Elasticsearch->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array, 10)
#6 src/XF/Search/Search.php(185): XFES\Search\Source\Elasticsearch->search(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10)
#7 src/XF/Search/Search.php(214): XF\Search\Search->XF\Search\{closure}(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10)
#8 src/addons/SV/ElasticSearchEssentials/XF/Search/Search.php(45): XF\Search\Search->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10, Object(Closure), true)
#9 src/XF/Search/Search.php(181): SV\ElasticSearchEssentials\XF\Search\Search->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10, Object(Closure), true)
#10 src/addons/SV/ElasticSearchEssentials/Service/AutoCompleter.php(532): XF\Search\Search->search(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10, true)
#11 src/addons/SV/ElasticSearchEssentials/Service/SimilarContentFinder.php(357): SV\ElasticSearchEssentials\Service\AutoCompleter->getResults()
#12 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(94): SV\ElasticSearchEssentials\Service\SimilarContentFinder->getSimilarContents()
#13 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(75): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->getSimilarThreadIdsFromEss(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#14 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(55): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->getSimilarThreadFromEss(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#15 src/addons/XFES/Widget/SimilarThreads.php(61): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->getSimilarThreadsCache(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#16 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(38): XFES\Widget\SimilarThreads->render()
#17 internal_data/code_cache/widgets/_11_xfes_thread_view_below_quick_reply_similar_threads.php(5): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->render()
#18 src/XF/Template/Templater.php(7679): XF\SubContainer\Widget->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, Array)
#19 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#20 src/XF/Template/Templater.php(1937): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#21 internal_data/code_cache/templates/l2/s5/public/thread_view.php(1163): XF\Template\Templater->widgetPosition('thread_view_bel...', Array)
#22 src/XF/Template/Templater.php(1652): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#23 src/addons/MaZ/AUN/XF/Template/Templater.php(39): XF\Template\Templater->renderTemplate('thread_view', Array, true, NULL)
#24 src/XF/Template/Template.php(24): MaZ\AUN\XF\Template\Templater->renderTemplate('public:thread_v...', Array)
#25 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#26 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#27 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#28 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#29 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#30 src/XF/App.php(2483): XF\Mvc\Dispatcher->run()
#31 src/XF.php(524): XF\App->run()
#32 index.php(20): XF::runApp('XF\\Pub\\App')
#33 {main}

Request state​

array(4) {
["url"] => string(15) "/threads/20036/"
["referrer"] => bool(false)
["_GET"] => array(0) {
}
 
XFES\Elasticsearch\RequestException:Elasticsearch error: [cpanel][127.0.0.1:9300][indices:data/read/search[phase/query]]
This is what is returned by ElasticSearch. You'll need to inspect the elasticsearch error logs to get the actual error message
 
Thanks, here is the Full error:

XFES\Elasticsearch\RequestException:Elasticsearch error: [cpanel][127.0.0.1:9300][indices:data/read/search[phase/query]]
For the record:

This error appeared when elasticsearch was in the middle of restarting itself. Why it is restarting is a harder question, that would require diving through systemctl and elasticsearch logs.
 
After a recent upgrade of XF and several add-ons, including this one, as well as PHP and ElasticSearch itself, I'm getting a few of these errors every day:

  • LogicException: Post has no thread
  • src/XF/ControllerPlugin/Thread.php:14
  • Generated by: Unknown account
  • Nov 26, 2023 at 11:59 AM

Stack trace​

#0 src/XF/Pub/Controller/Thread.php(287): XF\ControllerPlugin\Thread->getPostLink(Object(SV\ElasticSearchEssentials\XF\Entity\Post))
#1 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Thread->actionLatest(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'Latest', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#3 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#4 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#6 src/XF.php(524): XF\App->run()
#7 index.php(20): XF::runApp('XF\\Pub\\App')
#8 {main}

Is this error related to this add-on? The errors don't appear to be happening at cron intervals, the times are pretty random.
 
This is unrelated to this add-on. A thread has been hard-deleted without it's posts being removed.
 
This is unrelated to this add-on. A thread has been hard-deleted without it's posts being removed.
Strange, the thread in one of these errors I just checked is not deleted. And threads are never hard-deleted on the site.

  • LogicException: Post has no thread
  • src/XF/ControllerPlugin/Thread.php:14
  • Generated by: Unknown account
  • Nov 29, 2023 at 5:42 AM

Stack trace​

#0 src/XF/Pub/Controller/Thread.php(287): XF\ControllerPlugin\Thread->getPostLink(Object(SV\ElasticSearchEssentials\XF\Entity\Post))
#1 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Thread->actionLatest(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'Latest', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#3 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#4 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#6 src/XF.php(524): XF\App->run()
#7 index.php(20): XF::runApp('XF\\Pub\\App')
#8 {main}

Request state​

array(4) {
["url"] => string(32) "/threads/hey-there.309092/latest"
["referrer"] => string(69) "https://www.mysite.com/threads/getting-there.376581/post-152303111"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
 
Last edited:
That isn't going to help, it is completely unrelated to search but rather data about a thread/post isn't as expected.
 
Top Bottom