ElasticSearch Essentials

ElasticSearch Essentials [Paid] 3.15.12

No permission to buy ($30.00)
Need to see a stack trace, and also the search query which triggered that.

I have an add-on which will dump the search query into the exception message which is critical for debugging these issues;
 
Code:
XFES\Elasticsearch\RequestException: Elasticsearch error: [simple_query_string] unsupported field [quote_field_suffix] DSL:{"sort":["_score",{"date":"desc"}],"docvalue_fields":["discussion_id","user","date"],"_source":false,"size":600,"query":{"bool":{"filter":[{"bool":{"should":[{"bool":{"filter":[{"type":{"value":"page"}}]}},{"bool":{"filter":[{"bool":{"should":[{"type":{"value":"post"}},{"type":{"value":"thread"}}],"minimum_should_match":1}}],"must_not":[{"terms":{"node":[39,43,46,59,60,61,66,71,78,81,83,85,90,92,94,97,99,101,102,103,107,108,109,110,112,113,114,115,116,117,120,123,127,128,139,140,141,145,149,150,151,152,153,154,155,159,161]}}]}},{"bool":{"filter":[{"bool":{"should":[{"type":{"value":"profile_post"}},{"type":{"value":"profile_post_comment"}}],"minimum_should_match":1}}]}},{"bool":{"filter":[{"type":{"value":"xfmg_album"}}]}},{"bool":{"filter":[{"type":{"value":"xfmg_comment"}}]}},{"bool":{"filter":[{"type":{"value":"xfmg_media"}}]}}],"minimum_should_match":1}}],"must":[{"function_score":{"query":{"simple_query_string":{"query":"test","fields":["title","message","title.exact^1.5"],"default_operator":"and","quote_field_suffix":".exact"}},"functions":[]}}]}}} src/addons/XFES/Elasticsearch/Api.php:424



Code:
#0 src/addons/XFES/Elasticsearch/Api.php(338): XFES\Elasticsearch\Api->request('get', 'macuser_xf/_sea...', '{
    "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(34): XFES\Elasticsearch\Api->search(Array)
#3 src/addons/XFES/Search/Source/Elasticsearch.php(750): SV\SearchImprovements\XFES\Elasticsearch\Api->search(Array)
#4 src/addons/XFES/Search/Source/Elasticsearch.php(148): XFES\Search\Source\Elasticsearch->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array, '600')
#5 src/XF/Search/Search.php(185): XFES\Search\Source\Elasticsearch->search(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), '600')
#6 src/XF/Search/Search.php(214): XF\Search\Search->XF\Search\{closure}(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), '600')
#7 src/XF/Search/Search.php(187): XF\Search\Search->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), '600', Object(Closure), true)
#8 src/XF/Repository/Search.php(33): XF\Search\Search->search(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery))
#9 src/addons/SV/ElasticSearchEssentials/XF/Repository/XF22/Search.php(35): XF\Repository\Search->runSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array, true)
#10 src/addons/SV/ElasticSearchEssentials/Repository/SearchTrait.php(245): SV\ElasticSearchEssentials\XF\Repository\XF22\Search->SV\ElasticSearchEssentials\XF\Repository\XF22\{closure}(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array, true)
#11 src/addons/SV/ElasticSearchEssentials/XF/Repository/XF22/Search.php(41): SV\ElasticSearchEssentials\XF\Repository\XF22\Search->wrapRunSearchForSvEss(Object(Closure), Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array, true)
#12 src/XF/Pub/Controller/Search.php(432): SV\ElasticSearchEssentials\XF\Repository\XF22\Search->runSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array, true)
#13 src/XF/Pub/Controller/Search.php(119): XF\Pub\Controller\Search->runSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array)
#14 src/addons/SV/SearchImprovements/XF/Pub/Controller/Search.php(58): XF\Pub\Controller\Search->actionSearch()
#15 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Search.php(427): SV\SearchImprovements\XF\Pub\Controller\Search->actionSearch()
#16 src/XF/Mvc/Dispatcher.php(352): SV\ElasticSearchEssentials\XF\Pub\Controller\Search->actionSearch(Object(XF\Mvc\ParameterBag))
#17 src/XF/Mvc/Dispatcher.php(263): XF\Mvc\Dispatcher->dispatchClass('XF:Search', 'Search', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Search), NULL)
#18 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Search), NULL)
#19 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#20 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#21 src/XF.php(517): XF\App->run()
#22 index.php(20): XF::runApp('XF\\Pub\\App')
#23 {main}


Code:
array(4) {
  ["url"] => string(14) "/search/search"
  ["referrer"] => string(23) "https://www.xyz.de/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(3) {
    ["keywords"] => string(4) "test"
    ["c"] => array(1) {
      ["users"] => string(0) ""
    }
    ["_xfToken"] => string(8) "********"
  }
}
 
Xon updated ElasticSearch Essentials with a new update entry:

PSA: Potential security vulnerability in Elasticsearch and more via Apache Log4j (Log4Shell)

Elasticsearch currently contains a vulnerability which can allow remote code execution or leaking server IP.

It is strongly recommended to upgrade to Elasticsearch 6.3+ and apply the documented migration.

For more information see; PSA: Potential security vulnerability in Elasticsearch and more via Apache Log4j (Log4Shell)

Read the rest of this update entry...
 
@Xon a 'Wish List' suggestion... If no results are found for the inputted search value then return the search results for the most likely "Did you mean" entry if any are returned (or perhaps if only one is returned?). This would be similar to how Google does their searches.

A real world example of this is our photography forum where a search for "kodadk" is a typo for "kodak"; no search results are found and the only "Did you mean" entry is the wanted "kodak".

1639336734873.png

1639336886667.png
 
@Kevin I think that wouldn't be too hard todo. Will look into it in the next few weeks
Old School Reaction GIF
 
Hello @Xon ,

probably I`m doing something wrong ... when I try to install via commandline I get following Errors

php cmd.php xf-addon:install SV/ElasticSearchEssentials
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /var/www/xf/src/XF/Db/Mysqli/Adapter.php:152
Stack trace:
#0 /var/www/xf/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 /var/www/xf/src/XF/Error.php(87): XF\Db\Mysqli\Adapter->getConnection()
#2 /var/www/xf/src/XF/App.php(2362): XF\Error->logException(Object(Error), true, '')
#3 /var/www/xf/src/XF.php(201): XF\App->logException(Object(Error), true)
#4 [internal function]: XF::handleException(Object(Error))
#5 {main}
thrown in /var/www/xf/src/XF/Db/Mysqli/Adapter.php on line 152
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /var/www/xf/src/XF/Db/Mysqli/Adapter.php:152
Stack trace:
#0 /var/www/xf/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 /var/www/xf/src/XF/Error.php(87): XF\Db\Mysqli\Adapter->getConnection()
#2 /var/www/xf/src/XF/App.php(2362): XF\Error->logException(Object(ErrorException), true, '')
#3 /var/www/xf/src/XF.php(241): XF\App->logException(Object(ErrorException), true)
#4 [internal function]: XF::handleFatalError()
#5 {main}
thrown in /var/www/xf/src/XF/Db/Mysqli/Adapter.php on line 152
www-data@ubuntu:~/xf$ php cmd.php xf-addon:install SV/ElasticSearchEssentials
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /var/www/xf/src/XF/Db/Mysqli/Adapter.php:152
Stack trace:
#0 /var/www/xf/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 /var/www/xf/src/XF/Error.php(87): XF\Db\Mysqli\Adapter->getConnection()
#2 /var/www/xf/src/XF/App.php(2362): XF\Error->logException(Object(Error), true, '')
#3 /var/www/xf/src/XF.php(201): XF\App->logException(Object(Error), true)
#4 [internal function]: XF::handleException(Object(Error))
#5 {main}
thrown in /var/www/xf/src/XF/Db/Mysqli/Adapter.php on line 152
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /var/www/xf/src/XF/Db/Mysqli/Adapter.php:152
Stack trace:
#0 /var/www/xf/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 /var/www/xf/src/XF/Error.php(87): XF\Db\Mysqli\Adapter->getConnection()
#2 /var/www/xf/src/XF/App.php(2362): XF\Error->logException(Object(ErrorException), true, '')
#3 /var/www/xf/src/XF.php(241): XF\App->logException(Object(ErrorException), true)
#4 [internal function]: XF::handleFatalError()
#5 {main}

Running:

Ubuntu 18.04
MariaDB Ver 15.1 Distrib 10.4.22
php 7.4
ElasticSearch 7.16.1
ElasticSearch Essentials 3.8.14
XenForo 2.2.8


Regards
 
Code:
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_init()
Ensure the CLI environment passes the XenForo requirements. It looks like the CLI has different extensions enable to the webserver (php-fpm?) does.
 
Small problem with the auto-complete functionality in combination with PixelExit themes.
It seems the add-on has support for it, but the modification does not get applied.

This is with XenBase:

PAGE_CONTAINER
Code:
<form action="{{ link('search/search') }}" id="xbSearch" class="xb-search" method="post" data-no-auto-focus="true">

FIND (does not work):
Code:
#<form action="{{ link\('search\/search'\.*?\) }}" id="xbSearch"#si
 
Is there any setting I can use for auto-suggest to emphasize on "first words"?

Say 2 thread titles are

1. Today the whole world will be seeing the most important figure in history

2. The whole history is important for today's world

Now when I search for today the whole both titles appear in auto-suggest because both titles contain these 3 words.

However, if you look closely I am much likely searching for the 1st title because of the word order I used.
The second title has these words not one after the other.

So I want the search emphasis on "first words" of a title or like "exact match" kind of emphasis.

Hope you understand what I mean.

Is there any setting I can make this happen?
 
Are you using relevancy search?

Not really sure how to wangle the autocomplete or the search to behave like that. I think the full search does behave like that but I'm a little unsure
 
  • Like
Reactions: sbj
Are you using relevancy search?
Yeah, I do.

I thought maybe ES has some other weighting options to use.

My users complain a lot that what they are looking for never happen to be the 1st or 2nd result in the auto-complete. They have to type too many words in order to get it. Sometimes they say the result is so below on the list that they think the site does not have it.

All of this problem could be solved if it behaved more like exact match, which considers word order. In my example above the 2nd thread title would have not been found by it for example at all.

So both have their advantages and disadvantages.
 
All of this problem could be solved if it behaved more like exact match, which considers word order. In my example above the 2nd thread title would have not been found by it for example at all.
Have you enabled the "Exact text search - title" option on the Enhanced search setup page and done an index rebuild? This may help improve autocomplete behaviour as it can do better matching
 
  • Like
Reactions: sbj
Have you enabled the "Exact text search - title" option on the Enhanced search setup page and done an index rebuild? This may help improve autocomplete behaviour as it can do better matching
I am not sure if I did that.

Also, just to be sure, I don't want exact text search, I like the way it is now, because it finds better results. I just want better weighting I guess?

In any case, where do I find that option? Can't see that.

Do I need to reconfigure it?

Edit:

Well, I forgot to update your addon. The old version did not have that option. I now checked that option and rebuilding the search index. Will report back later.
 
Last edited:
Top Bottom