We upgrade from the version 1.35.8 LTS to 1.39.1 LTS and we get the following Issues:
1- "connection to localhost:9312 failed (errno=111, msg=Connection refused)"
2- "Interner Fehler: received zero-sized searchd response"
Hier are the fix for this issues:
- SphinxMWSearchResult:
@@ -20,9 +20,10 @@ class SphinxMWSearchResult extends RevisionSearchResult {
* @param stdClass $row
* @param SphinxClient|null $sphinx_client
*/
public function __construct( $row, $sphinx_client ) {
public function __construct( $row, $sphinx_client, $terms ) {
$this->sphinx_client = $sphinx_client;
$this->initFromTitle( Title::makeTitle( $row->page_namespace, $row->page_title ) );
$this->terms = $terms;
}
/**
@@ -40,9 +41,9 @@ public function getTextSnippet( $terms = [] ) {
if ( $wgSphinxSearchMWHighlighter ) {
$h = new SearchHighlighter();
if ( $wgAdvancedSearchHighlighting ) {
return $h->highlightText( $this->mText, $terms, $contextlines, $contextchars );
return $h->highlightText( $this->mText, $this->terms, $contextlines, $contextchars );
} else {
return $h->highlightSimple( $this->mText, $terms, $contextlines, $contextchars );
return $h->highlightSimple( $this->mText, $this->terms, $contextlines, $contextchars );
}
}
@@ -57,7 +58,7 @@ public function getTextSnippet( $terms = [] ) {
$excerpts = $this->sphinx_client->BuildExcerpts(
[ $this->mText ],
$wgSphinxSearch_index,
implode( ' ', $terms ),
implode( ' ', $this->terms ),
$excerpts_opt
);
- SphinxMWSearchResultSet:
@@ -245,7 +245,7 @@ public function next() {
if ( isset( $this->mResultSet[$this->mNdx] ) ) {
$row = $this->mResultSet[$this->mNdx];
++$this->mNdx;
return new SphinxMWSearchResult( $row, $this->sphinx_client );
return new SphinxMWSearchResult( $row, $this->sphinx_client, $this->mTerms );
} else {
return false;
}