Search Improvements

Search Improvements 2.13.1

No permission to download
Is it expected to see lots of errors when dsl logging is enabled? For example:

Code:
ErrorException: {"docvalue_fields":["discussion_id","user","date"],"_source":false,"size":10,"query":{"bool":{"must":{"multi_match":{"type":"most_fields","query":"gibson les paul standard ve standard plus farklar\u0131","operator":"or","fields":["title","elasticess_title"],"cutoff_frequency":0.001}},"filter":[{"term":{"type":"thread"}},{"term":{"node":32}}],"must_not":[{"exists":{"field":"hidden"}},{"term":{"thread":17139}},{"terms":{"node":[18,30,86,42]}}]}}} src/XF/Error.php:75



Stack Trace

#0 src/XF.php(184): XF\Error->logError('{"docvalue_fiel...', false)
#1 src/addons/SV/SearchImprovements/XFES/Elasticsearch/Api.php(19): XF::logError('{"docvalue_fiel...')
#2 src/addons/XFES/Search/Source/Elasticsearch.php(153): SV\SearchImprovements\XFES\Elasticsearch\Api->search(Array)
#3 src/addons/SV/ElasticSearchEssentials/XFES/Search/Source/Elasticsearch.php(377): XFES\Search\Source\Elasticsearch->search(Object(SV\ElasticSearchEssentials\XF\Search\Query\Query), 10)
#4 src/XF/Search/Search.php(175): SV\ElasticSearchEssentials\XFES\Search\Source\Elasticsearch->search(Object(SV\ElasticSearchEssentials\XF\Search\Query\Query), 10)
#5 src/addons/SV/ElasticSearchEssentials/Service/AutoCompleter.php(501): XF\Search\Search->search(Object(SV\ElasticSearchEssentials\XF\Search\Query\Query), 10, true)
#6 src/addons/SV/ElasticSearchEssentials/Service/SimilarContentFinder.php(320): SV\ElasticSearchEssentials\Service\AutoCompleter->getResults()
#7 src/addons/SV/ElasticSearchEssentials/ControllerPlugin/SimilarContent.php(42): SV\ElasticSearchEssentials\Service\SimilarContentFinder->getSimilarContents()
#8 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Thread.php(30): SV\ElasticSearchEssentials\ControllerPlugin\SimilarContent->addSimilarContent(Object(XF\Mvc\Reply\View), Object(SV\ElasticSearchEssentials\XF\Entity\Forum), Object(SV\ElasticSearchEssentials\XF\Entity\Thread), 'svSimilarThread...')
#9 src/XF/Mvc/Dispatcher.php(350): SV\ElasticSearchEssentials\XF\Pub\Controller\Thread->actionIndex(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'Index', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#11 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#12 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#14 src/XF.php(391): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}


Request state
array(4) {
  ["url"] => string(12) "/konu/17139/"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Last edited:
The DSL logging just dumps into the error log, so that is as-designed. It is more of a debugging tool than anything else so I don't recommend leaving it enabled all the time.
 
This may not be the correct discussion, but we are looking at larger search problems that would normally use multiple term searches and search logic. It seems to me there must be some documentation on the details of a search expression in advanced search, but I cannot seem to find it.

Even with that information most of my users would not be willing/able to learn the usage unless they were doing a serious project that needed it.

I have been asked if the results of a search could be the content type for a new search, so that less sophisticated users could iterate toward the final search result.
 
Assuming you are using the enhanced search with Elasticsearch backend, what’s an example of an advanced search you can’t carry out? I found the built in Xenforo search useless but Elasticsearch has been very good for my site.
 
More complex changes are often part of one of my paid add-ons;

I do not feel it is worth the complexity supporting ElasticSearch and MySQL search for the more in-depth features.
 
Assuming you are using the enhanced search with Elasticsearch backend, what’s an example of an advanced search you can’t carry out? I found the built in Xenforo search useless but Elasticsearch has been very good for my site.
Where is the documentation for forming expressions in a search in Elasticsearch? An advanced example would be WordA and WordB in paragraph.

A better example might be One of (worda, wordb, wordc) and Thisword. Basically, I do not know what the operators or syntax are.

The specific request I have had was the ability to name a search result and use it as a content type. Which was described as search within results.
 
l was looking at ELasticsearch simple query string and I could imagine that is what is supported in XenForo. But, most of it depends on settings, so it is not at all clear.

Is it the case the simple query is always used and all the tags are allowed with the default "and"

My presumption is that in the example query, the only thing provided by the XenForo user is the "foo bar -baz" and the outer query is hard coded for any given content type.

Code:
The simple_query_string query supports the following operators:

+ signifies AND operation
| signifies OR operation
- negates a single token
" wraps a number of tokens to signify a phrase for searching
* at the end of a term signifies a prefix query
( and ) signify precedence
~N after a word signifies edit distance (fuzziness)
~N after a phrase signifies slop amount
To use one of these characters literally, escape it with a preceding backslash (\).

{
    "query": {
        "simple_query_string" : {
            "fields" : ["content"],
            "query" : "foo bar -baz"
        }
    }
}
 
With Xon's Search Improvements and Enhanced search:
  • + signifies AND operation
  • | signifies OR operation
  • - negates a single token
  • " wraps a number of tokens to signify a phrase for searching
  • * at the end of a term signifies a prefix query
  • ( and ) signify precedence
  • ~N after a word signifies edit distance (fuzziness)
  • ~N after a phrase signifies slop amount
 
More problems:

Code:
    ErrorException: Template error: Method canViewUsers is not callable on the given object (SV\SearchImprovements\XF\Entity\User) src/XF/Template/Templater.php:994

Stack-Trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canViewU...', '/var/www/h...', 994, Array)
#1 src/XF/Template/Templater.php(994): trigger_error('Method canViewU...', 512)
#2 internal_data/code_cache/navigation_cache.php(611): XF\Template\Templater->method(Object(SV\SearchImprovements\XF\Entity\User), 'canViewUsers', Array)
#3 src/XF/Template/Templater.php(6660): XF\Pub\App->{closure}(Object(WMTech\TimeSpentOnline\XF\Template\Templater), NULL, Array)
#4 src/XF/Pub/App.php(560): XF\Template\Templater->renderNavigationClosure(Object(Closure), NULL, Array)
#5 src/XF/Pub/App.php(513): XF\Pub\App->getNavigation(Array, NULL)
#6 src/XF/App.php(2001): XF\Pub\App->renderPageHtml('








            <fo...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#7 src/XF/Mvc/Dispatcher.php(402): XF\App->renderPage('








            <fo...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#8 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#9 src/XF/App.php(2190): XF\Mvc\Dispatcher->run()
#10 src/XF.php(391): XF\App->run()
#11 index.php(20): XF::runApp('XF\\Pub\\App')
#12 {main}

Status der Anfrage

array(4) {
  ["url"] => string(15) "/login/register"
  ["referrer"] => string(41) "https://www.forum.com/index.php?register"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}



There are no problems without that addon here:

#3 src/XF/Template/Templater.php(6660): XF\Pub\App->{closure}(Object(WMTech\TimeSpentOnline\XF\Template\Templater), NULL, Array)
 
More problems:

Code:
    ErrorException: Template error: Method canViewUsers is not callable on the given object (SV\SearchImprovements\XF\Entity\User) src/XF/Template/Templater.php:994

Stack-Trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canViewU...', '/var/www/h...', 994, Array)
#1 src/XF/Template/Templater.php(994): trigger_error('Method canViewU...', 512)
#2 internal_data/code_cache/navigation_cache.php(611): XF\Template\Templater->method(Object(SV\SearchImprovements\XF\Entity\User), 'canViewUsers', Array)
#3 src/XF/Template/Templater.php(6660): XF\Pub\App->{closure}(Object(WMTech\TimeSpentOnline\XF\Template\Templater), NULL, Array)
#4 src/XF/Pub/App.php(560): XF\Template\Templater->renderNavigationClosure(Object(Closure), NULL, Array)
#5 src/XF/Pub/App.php(513): XF\Pub\App->getNavigation(Array, NULL)
#6 src/XF/App.php(2001): XF\Pub\App->renderPageHtml('








            <fo...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#7 src/XF/Mvc/Dispatcher.php(402): XF\App->renderPage('








            <fo...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#8 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#9 src/XF/App.php(2190): XF\Mvc\Dispatcher->run()
#10 src/XF.php(391): XF\App->run()
#11 index.php(20): XF::runApp('XF\\Pub\\App')
#12 {main}

Status der Anfrage

array(4) {
  ["url"] => string(15) "/login/register"
  ["referrer"] => string(41) "https://www.forum.com/index.php?register"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}



There are no problems without that addon here:

#3 src/XF/Template/Templater.php(6660): XF\Pub\App->{closure}(Object(WMTech\TimeSpentOnline\XF\Template\Templater), NULL, Array)
This is unrelated to any of my add-ons. Just because you see one of my add-ons as part of the arguments to a function does not mean it is my add-on.

Search src/addons for canViewUsers and you should find whatever add-on is trying to, incorrectly, use it.
 
Getting the following error on xf v2.2.0 beta 1

Screenshot 2020-08-04 073442.webp


PHP:
Error: Call to undefined method XF\Search\Query\KeywordQuery::setMetadataConstraints() src/addons/SV/SearchImprovements/XF/Search/Source/MySqlFt.php:39
    
    
    #0 src/XF/Search/Search.php(183): SV\SearchImprovements\XF\Search\Source\MySqlFt->search(Object(XF\Search\Query\KeywordQuery), '200')
#1 src/XF/Search/Search.php(212): XF\Search\Search->XF\Search\{closure}(Object(XF\Search\Query\KeywordQuery), '200')
#2 src/XF/Search/Search.php(179): XF\Search\Search->executeSearch(Object(XF\Search\Query\KeywordQuery), '200', Object(Closure), true)
#3 src/XF/Repository/Search.php(34): XF\Search\Search->search(Object(XF\Search\Query\KeywordQuery))
#4 src/XF/Pub/Controller/Search.php(430): XF\Repository\Search->runSearch(Object(XF\Search\Query\KeywordQuery), Array, true)
#5 src/XF/Pub/Controller/Search.php(117): XF\Pub\Controller\Search->runSearch(Object(XF\Search\Query\KeywordQuery), Array)
#6 src/addons/SV/SearchImprovements/XF/Pub/Controller/Search.php(55): XF\Pub\Controller\Search->actionSearch()
#7 src/XF/Mvc/Dispatcher.php(350): SV\SearchImprovements\XF\Pub\Controller\Search->actionSearch(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Search', 'Search', 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(2270): XF\Mvc\Dispatcher->run()
#12 src/XF.php(417): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}
 
That is expected.

I've got a fix in progress but I'm still working on ElasticSearch Essentials which this add-on interacts with heavily.
 
Last edited:
That is expected.

I've got a fix in progress but I'm still working on ElasticSearch Essentials which this add-on interacts with heavily.
No probs it happens :LOL: Some don't run x2.2.0 on live site but i'm just that much of a crazy daredevil guy, i keep it disabled for now!
 
This looks like it would allow to switch the order of the search, but it doesn't seem to do so? Specifically, I only see one option in the admin panel, and none as a user.
 
Ah, it looks like that's to replace search by relevance issues. My bad.

Oh well, hopefully search sorting on the basic search can be a thing at some point.
 
Top Bottom