Jump to content

Topic on Extension talk:SphinxSearch

Issues with SphinxSearch in 1.34

5
206.130.173.59 (talkcontribs)

I upgraded mediawiki to 1.34 and SphinxSearch to the version that matches version 1.34. When I run a search I get this error:

[895083e3cfe4edcfab999700] /testwiki/index.php?search=Celia&title=Spezial%3ASuche&go=Seite ArgumentCountError from line 28 of /srv/www/htdocs/testwiki/extensions/SphinxSearch/SphinxMWSearchResult.php: Too few arguments to function SphinxMWSearchResult::getTextSnippet(), 0 passed in /srv/www/htdocs/testwiki/includes/widget/search/FullSearchResultWidget.php on line 65 and exactly 1 expected

When I took a look at SphinxMWSearchResult.php found that getTextSnippet is expecting the parameter terms

       public function getTextSnippet( $terms ) {


However I found this in the 1.34 release notes.

* SearchResult::getTextSnippet( $terms ) the $terms param is being deprecated

  and should no longer be passed. Search engine implemenations should be

  responsible for carrying relevant information needed for highlighting with

  their own SearchResultSet/SearchResult sub-classes.


Is the error caused by a bug or by a configuration issue?

Lavamind (talkcontribs)
2601:646:C900:1338:D1E3:28DE:1BAE:1145 (talkcontribs)

Thank you, Lavamind!

195.234.58.40 (talkcontribs)

for 1.35 add the if

       public function getTextSnippet( $terms = [] ) {
               global $wgAdvancedSearchHighlighting, $wgSphinxSearchMWHighlighter, $wgSphinxSearch_index;
               if (empty($terms)) {
                       $terms=$this->mterms ;
               }

195.234.58.40 (talkcontribs)

sorry, I didn't read all your comments:

the solution from Lavamind is the solution

Reply to "Issues with SphinxSearch in 1.34"