Extension talk:SphinxSearch

Jump to navigation Jump to search

About this board

Archives 
The talk page now uses liquid threads, all open messages prior to liquid threads have been converted into a talk subpage and can be found here.
It is recommended to use SphinxSearch 0.8.5 and a recent stable release of Sphinx 2.1. Please bear in mind that this extension only handles the communication between MediaWiki and Sphinx and any specific issues related to the search feature (character sets, ability to search with *, search categories, minimum length on search terms etc.) are handled in Sphinx (see sphinx.conf file) and those questions should be redirected to the Sphinx forum.
The development on this extension is done on a voluntary basis and while this forum provides a platform to share experiences and solutions, it is up to its community members to fill in suggestions.

Help

When seeking help and/or support, you might want to consider to mention your system environment (SphinxSearch Extension version, Sphinx version, MW version etc.) otherwise it might be difficult for people to make appropriate recommendations.

For Windows users and related issues see here, for Linux users and related issues see here, and some advice on how to configure a SQLite setup see here.


mediawiki-1.32.0 sphinxsearch-0.9 error

2
Atyu30 (talkcontribs)

2019/01/14 12:04:51 [error] 21549#21549: *3558 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class SphinxMWSearch contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (SearchDatabase::doSearchTextInDB, SearchDatabase::doSearchTitleInDB) in /var/opt/www/extensions/SphinxSearch/SphinxMWSearch.php on line 15" while reading response header from upstream, client: 192.168.122.1, server: wiki.yuyizhi.org, request: "GET /index.php?title=Special:%E6%90%9C%E7%B4%A2&search=sphinx HTTP/1.0", upstream: "fastcgi://unix:/var/run/php-fpm/php5-fpm.sock:", host: "wiki.yuyizhi.org"

Ofbeaton (talkcontribs)

The SearchDatabase class that SphinxSearch extends was changed from REL1_31 to REL1_32. It now requires you to define doSearchTextInDB and doSearchTitleInDB methods.

See REL1_31 https://doc.wikimedia.org/mediawiki-core/REL1_31/php/classSearchDatabase.html vs REL1_32 https://doc.wikimedia.org/mediawiki-core/REL1_32/php/classSearchDatabase.html

This is sortof mentioned in the patch notes if you search for Search under deprecation (note this is a Backwards compatibility break instead) https://www.mediawiki.org/wiki/Release_notes/1.32#Compatibility:

> Overriding SearchEngine::{searchText,searchTitle,searchArchiveTitle} in extending classes is deprecated. Extend related doSearch* methods instead.

If you are like me and not comfortable fixing the extension yourself, you will have to wait for one of the extension contributors to update the extension to work with REL1_32. Until then you will have to stay on REL1_31 if you wish to use the extension.

Reply to "mediawiki-1.32.0 sphinxsearch-0.9 error"
Venkat sabarish (talkcontribs)

Hi,

in the default mediawiki search when we type a word say "downtime" with space inbetween its results in search of 'down" and 'time" both words separately but after installing Sphinx what happens is that even that behavior found in MW default search is not found here and what happens is that the exact words match as in the format "down time" if available in the article, then that result pops up

Venkat sabarish (talkcontribs)

any help ? from the MW community

Reply to "space between words issue"
199.244.214.111 (talkcontribs)

Hi guys,I am trying to implement Did You Mean feature on my windows mediawiki setup,but none of three(Enchant,Aspell,Soundex) are working.

For soundex- I have included $wgSphinxSuggestMode = 'soundex'; in localsettings.php file and I am getting this error -"A database query error has occurred. This may indicate a bug in the software"

For enchant-I replaced soundex with 'enchant',I ran the following as per the instructions -

"C:\WINDOWS\system32>C:\xampp\php\php C:\xampp\apps\mediawiki\htdocs\extensions\S

phinxSearch\SphinxSearch_setup.php --sphinxconf C:\sphinx\bin\"

and I get this error-

The filename, directory name, or volume label syntax is incorrect."

For aspell - When I try and install "Aspell-0-50-3-3-Setup.exe" I am getting a lot of errors and setup is not getting completed to move further

Could anyone please help me solve this.

Venkat sabarish (talkcontribs)

I'm also clueless in how to enable the "did you mean feature" using enchant. Its been 2years ago you posted this question and did you find a answer regarding this. If so kindly help me as I'm working with Mediawiki

Reply to "Did You Mean.... Feature Issue"

key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details.

1
Xk casper (talkcontribs)

The version of sphinx have been changed after using “yum update”.

The new version maybe not support "sql_query_info".

WARNING infomation like this:

using config file '/usr/local/sphinx--with-mysql/etc/sphinx.conf'...WARNING: key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details.

WARNING: key 'enable_star' was permanently removed from Sphinx configuration. Refer to documentation for details.

WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.

WARNING: key 'max_matches' was permanently removed from Sphinx configuration. Refer to documentation for details.

Anyone can tell me how to fix it ?

Reply to "key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details."
RobFantini (talkcontribs)

these are notes after spending hours to get sphinx working on debian 9. they may not be complete .

using stretch package I could not get sphinx to stay running.

however using a jessie deb it works fine.

see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861262 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=788284

also after i had to do these.

chown  -R  sphinxsearch /var/log/sphinx

and in /etc/init.d/sphinxsearch



PIDFILE=/var/log/sphinx/searchd.pid


in our case /etc/sphinxsearch/sphinx.conf did not have a PIDFILE specified . could be that years ago it just worked using the one under /var/log/sphinxsearch .

RobFantini (talkcontribs)

then had to fix systemd :

problem: Setting up sphinxsearch (2.2.11-release-1~jessie) ...


Do not forget to reindex all indexes by running: indexer --all


Job for sphinxsearch.service failed because a timeout was exceeded.

See "systemctl status sphinxsearch.service" and "journalctl -xe" for details.

invoke-rc.d: initscript sphinxsearch, action "start" failed.

● sphinxsearch.service - SphinxSearch Search Engine

  Loaded: loaded (/lib/systemd/system/sphinxsearch.service; enabled; vendor preset: enabled)
  Active: failed (Result: timeout) since Sat 2018-10-13 08:53:09 EDT; 6ms ago

  Process: 17708 ExecStart=/usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf (code=exited, status=0/SUCCESS)

  Process: 17706 ExecStartPre=/bin/chown sphinxsearch.sphinxsearch /var/run/sphinxsearch (code=exited, status=0/SUCCESS)

  Process: 17704 ExecStartPre=/bin/mkdir -p /var/run/sphinxsearch (code=exited, status=0/SUCCESS)

   Tasks: 8 (limit: 4915)
  CGroup: /system.slice/sphinxsearch.service
          ├─905 /usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf
          └─908 /usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf


Oct 13 08:51:39 wiki searchd[17708]: Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)

Oct 13 08:51:39 wiki searchd[17708]: FATAL: failed to lock pid file '/var/log/sphinx/searchd.pid': Resource temporarily unavai…running?)

Oct 13 08:51:39 wiki searchd[17708]: Sphinx 2.2.11-id64-release (95ae9a6)

Oct 13 08:51:39 wiki searchd[17708]: Copyright (c) 2001-2016, Andrew Aksyonoff

Oct 13 08:51:39 wiki searchd[17708]: Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)

Oct 13 08:51:39 wiki systemd[1]: sphinxsearch.service: PID file /var/run/sphinxsearch/searchd.pid not readable (yet?) after s… directory

Oct 13 08:53:09 wiki systemd[1]: sphinxsearch.service: Start operation timed out. Terminating.

Oct 13 08:53:09 wiki systemd[1]: Failed to start SphinxSearch Search Engine.

Oct 13 08:53:09 wiki systemd[1]: sphinxsearch.service: Unit entered failed state.

Oct 13 08:53:09 wiki systemd[1]: sphinxsearch.service: Failed with result 'timeout'.

Hint: Some lines were ellipsized, use -l to show in full.

dpkg: error processing package sphinxsearch (--configure):

subprocess installed post-installation script returned error exit status 1

Errors were encountered while processing:

sphinxsearch

E: Sub-process /usr/bin/dpkg returned an error code (1)


chmod 777  /var/run/sphinxsearch/   

  1. did not fix.

updatedb

  1. locate searchd.pid

/var/log/sphinx/searchd.pid


    1. So ....

vi /lib/systemd/system/sphinxsearch.service

  1. change this:

PIDFile=/var/log/sphinx/searchd.pid


    1. rebooted then
# systemctl status sphinxsearch

● sphinxsearch.service - SphinxSearch Search Engine

  Loaded: loaded (/lib/systemd/system/sphinxsearch.service; enabled; vendor preset: enabled)
  Active: active (running) since Sat 2018-10-13 09:20:30 EDT; 1min 31s ago

  Process: 828 ExecStart=/usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf (code=exited, status=0/SUCCESS)

  Process: 824 ExecStartPre=/bin/chown sphinxsearch.sphinxsearch /var/run/sphinxsearch (code=exited, status=0/SUCCESS)

  Process: 819 ExecStartPre=/bin/mkdir -p /var/run/sphinxsearch (code=exited, status=0/SUCCESS)

Main PID: 855 (searchd)
   Tasks: 8 (limit: 4915)
  CGroup: /system.slice/sphinxsearch.service
          ├─854 /usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf
          └─855 /usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf


Oct 13 09:20:30 wiki searchd[828]: Copyright (c) 2001-2016, Andrew Aksyonoff

Oct 13 09:20:30 wiki searchd[828]: Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)

Oct 13 09:20:30 wiki searchd[828]: listening on all interfaces, port=9312

Oct 13 09:20:30 wiki searchd[828]: Sphinx 2.2.11-id64-release (95ae9a6)

Oct 13 09:20:30 wiki searchd[828]: Copyright (c) 2001-2016, Andrew Aksyonoff

Oct 13 09:20:30 wiki searchd[828]: Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)

Oct 13 09:20:30 wiki searchd[828]: precaching index 'wiki_main'

Oct 13 09:20:30 wiki searchd[828]: [249B blob data]

Oct 13 09:20:30 wiki systemd[1]: sphinxsearch.service: Supervising process 855 which is not our child. We'll most likely not notice when

Oct 13 09:20:30 wiki systemd[1]: Started SphinxSearch Search Engine.

Reply to "debian 9 notes"

How to use Sphinx and Flow together?

1
Xk casper (talkcontribs)

After use the Flow to replace the NS_UserTalk,find that talk-page could not searched by Sphinx。

How to use Sphinx and Flow together?

Reply to "How to use Sphinx and Flow together?"

PHP 4 constructor deprecation warnings

1
Mg169706 (talkcontribs)

If you use PHP7 you might get a warning about deprecated class constructors. The simplest thing to do here is to rename the existing constructor to __construct() and create a new stub function with the old constructor name. The stub function points to the new constructor, so it'll work in both PHP 4, 5 and 7. See example below.

// PHP 4 Constructor

     function SphinxClient () {

               self::__construct();

       }

// PHP 7 Constructor

       function __construct () {

// Original constructor code goes here...

}

Reply to "PHP 4 constructor deprecation warnings"

Is there any chance to index uploaded files ?

1
BluAlien (talkcontribs)

Hi everybody. I would like to know if there is any chance to index uploded files such as pdf, doc, docx ecc. I used the FiledIndexer extension with Sphinx Search engine but this extention was retired because unsecure, and what I'm looking for is something similar

Thanks a lot in advance. Bye

Reply to "Is there any chance to index uploaded files ?"

Exclude a Category from indexing?

1
98.174.255.150 (talkcontribs)

Is there a clear way to exclude articles in a particular category from indexing with Sphinx? I haven't been able to find a clear answer on this through lots of searching. I've found plenty of discussion on excluding categories form searches, but i want to have a specialized category such as "Category:NoIndex" excluded from even being indexed in the first place.

Reply to "Exclude a Category from indexing?"

use of removed function breaks some searches in mw 1.27

1
2001:4898:80E8:D:0:0:0:34A (talkcontribs)

The following patch needs to be applied when running on 1.27.x. It took us a while to run into this issue so you may not see immediate breakage after upgrading. The change is what's recommended on Manual:Messages API#Deprecated wfMsg.2A functions.

diff --git a/extensions/SphinxSearch/SphinxMWSearch.php b/extensions/SphinxSearch/SphinxMWSearch.php

index 4aea2b6..a6bed43 100644

--- a/extensions/SphinxSearch/SphinxMWSearch.php

+++ b/extensions/SphinxSearch/SphinxMWSearch.php

@@ -226,7 +226,7 @@ class SphinxMWSearch extends SearchEngine {

global $wgContLang, $wgCanonicalNamespaceNames, $wgNamespaceAliases;

// "search everything" keyword

-               $allkeyword = wfMsgForContent( 'searchall' );

+               $allkeyword = wfMessage( 'searchall' )->inContentLanguage()->text();

$this->prefix_handlers[ $allkeyword ] = 'searchAllNamespaces';

$all_prefixes = array_merge(

Reply to "use of removed function breaks some searches in mw 1.27"