Jump to content

Extension talk:Elastica

Add topic
From mediawiki.org
Latest comment: 1 year ago by Senouis in topic Unexpected Elasticsearch failure?


Elastica/Elastica appears to already contain the necessary files

[edit]

The instructions say to download a master.zip file and unpack it into Elastica/Elastica. However, it appears that in the 1.22 snapshot and also origin/master that all the necessary files are already in the Elastica/Elastica folder. Should the extension page be corrected? Lsilverman (talk) 04:41, 21 February 2014 (UTC)Reply

Missing REL1_23 branch

[edit]

This extension seems to be missing a REL1_23 branch. Can I just use Elastica@master with CirrusSearch@REL1_23? I filed bugzilla:67270 for it. Legoktm (talk) 06:53, 29 June 2014 (UTC)Reply

The answer is no it seems, I was getting a fatal error on Special:Version when I tried it. Using Elastica@e1127206d16c364a2ad7b6d16f2287e49ce4a7fa seems to work. Legoktm (talk) 07:14, 29 June 2014 (UTC)Reply

Fatal error when using PHP 7

[edit]

Fatal error: Cannot use 'Bool' as class name as it is reserved in /extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Query/Bool.php on line 15

They have update this & CirrusSearch extensions for PHP7 support. However, the new extensions only work with MW1.27+ (which is not ready till May 2016). Hope someone could write a 1.26 version PHP 7 fix. Deletedaccount4567435 (talk) 16:09, 31 December 2015 (UTC)Reply
Thank you for the information. I hope it, too. Jaider msg 21:28, 2 January 2016 (UTC)Reply
Here is my modified version for you Jaideraf
  1. Delete all Elastica & CirrusSearch files.
  2. Download new 1.26 stable ver Elastica from Special:ExtensionDistributor/Elastica & copy to /extensions
  3. Run composer install
  4. Download https://github.com/zoglun/mediawiki-extensions-CirrusSearch & copy to /extensions
Now it should work. Deletedaccount4567435 (talk) 01:38, 6 January 2016 (UTC)Reply
[edit]

Unexpected Elasticsearch failure?

[edit]

I had just get Elastica from extension:elastica site, and cirrussearch from Extension:CirrusSearch.

I'm assuming i have ElasticSearch since the following is stated in my version:

Therefore, i set the following from

$wgCirrusSearchServers = array( 'elasticsearch0', 'elasticsearch1', 'elasticsearch2', 'elasticsearch3' );

to

$wgCirrusSearchServers = "localhost''; 

There are other $wgCirrusSearch variables that you might want to change from their defaults.

Now run this script to generate your elasticsearch index:

 php $MW_INSTALL_PATH/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php

 Once i run the updateSearchIndexConfig script, the following error shows:

content index...
Fetching Elasticsearch version...
Unexpected Elasticsearch failure.
Http error communicating with Elasticsearch: Couldn't connect to host, Elastic search down?

ANy idea what would cause this or how do i enable elasticsearch? AmazingTrans (talk) 05:18, 9 January 2016 (UTC)Reply

installed elasticsearch and works. AmazingTrans (talk) 21:15, 18 January 2016 (UTC)Reply
Hey how did you solve the problem -
Http error communicating with Elasticsearch: Couldn't connect to host, Elastic search down? 204.63.44.143 (talk) 11:00, 14 September 2016 (UTC)Reply
I think i got electricsearch working, but cirrus didn't work and i quit pursuing it.
Anybody has any luck? would be great if someone can post about it. AmazingTrans (talk) 01:16, 30 November 2016 (UTC)Reply
What version of Elasticsearch do you use? It seems CirrusSearch is currently working ONLY in ElasticSearch <= 7.10.x -> Check Extension talk:CirrusSearch Senouis (talk) 15:23, 12 November 2024 (UTC)Reply

PHP version insufficient?

[edit]

The page says PHP 5.3+ works, yet when I run composer I get:

Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
 Problem 1
   - Installation request for satooshi/php-coveralls dev-master -> satisfiable by satooshi/php-coveralls[dev-master].
   - satooshi/php-coveralls dev-master requires php ^5.5 || ^7.0 -> your PHP version (5.4.16) does not satisfy that requirement.

... so "5.3+" is not accurate? Shawnomancy (talk) 19:05, 13 March 2017 (UTC)Reply

Which version of MediaWiki are you running? And more important, which version (REL1_2X) of the extension do you use, newer releases require newer versions of PHP. Mainframe98 talk 19:20, 13 March 2017 (UTC)Reply

Class 'Elastica\Transport\Http' not found

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Followig the steps here for MW1.28, I get the following error:

PHP Fatal error:  Class 'Elastica\Transport\Http' not found in /var/www/extensions/Elastica/ElasticaConnection.php on line 207

PHP Stack trace:

PHP   1. {main}() /var/www/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php:0

PHP   2. require_once() /var/www/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php:65

PHP   3. CirrusSearch\Maintenance\UpdateSearchIndexConfig->execute() /var/www/maintenance/doMaintenance.php:111

PHP   4. CirrusSearch\Maintenance\Maintenance->getConnection() /var/www/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php:54

PHP   5. spl_autoload_call() /var/www/extensions/CirrusSearch/includes/Maintenance/Maintenance.php:108

PHP   6. AutoLoader::autoload() /var/www/extensions/CirrusSearch/includes/Maintenance/Maintenance.php:108

PHP   7. require() /var/www/includes/AutoLoader.php:81

PHP   8. spl_autoload_call() /var/www/extensions/CirrusSearch/includes/Connection.php:29

Can anyone help please? CalNation (talk) 17:01, 18 May 2017 (UTC)Reply

The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Class 'Elastica\Transport\Http' not found

[edit]

Followig the steps here for MW1.30, I get the following error:

PHP Fatal error:  Class 'Elastica\Transport\Http' not found in /var/www/extensions/Elastica/ElasticaConnection.php on line 207 213.61.254.67 (talk) 14:02, 6 April 2018 (UTC)Reply

Resolution for information:
I must restart apache2, after that it is working. 213.61.254.67 (talk) 14:03, 6 April 2018 (UTC)Reply

Composer Install Failed?

[edit]

According to my shell client, the install "failed with error". But the terminal output looks ok. Does it look like this install failed?

Loading composer repositories with package information
Updating dependencies
Package operations: 2 installs, 0 updates, 0 removals
  - Installing elasticsearch/elasticsearch (5.3.0): Downloading (connecting...)���������������������������Downloading (0%)           ���������������������������Downloading (5%)����������������Downloading (10%)�����������������Downloading (15%)�����������������Downloading (20%)�����������������Downloading (25%)�����������������Downloading (30%)�����������������Downloading (35%)�����������������Downloading (40%)�����������������Downloading (45%)�����������������Downloading (50%)�����������������Downloading (55%)�����������������Downloading (60%)�����������������Downloading (65%)�����������������Downloading (70%)�����������������Downloading (75%)�����������������Downloading (80%)�����������������Downloading (85%)�����������������Downloading (90%)�����������������Downloading (95%)�����������������Downloading (100%)
  - Installing ruflin/elastica (5.3.0): Downloading (connecting...)���������������������������Downloading (100%)         ���������
Writing lock file
Generating autoload files

Johnywhy (talk) 12:13, 3 June 2018 (UTC)Reply

Composer Needed with require_once syntax?

[edit]

If i use older require_once syntax, do i still need Composer? Johnywhy (talk) 12:15, 3 June 2018 (UTC)Reply

Elastica not communicating with ES?

[edit]

How can I debug the query from a search, to see if the client or the server or the query itself is not sending/receiving the right data? Everything in my setup seems right, but still no results at ANY search query are being received. I'm desperate. The issue comes from here: Help talk:CirrusSearch/2018#h-No_results_by_any_means-2018-07-25T14:52:00.000Z

Any tip will be thank. RodolfoEBDR (talk) 19:11, 30 July 2018 (UTC)Reply

Call to undefined method Elastica\Query::setStoredFields

[edit]

Initial indexing went without issue. When I search my wiki I get this error:

[W60b6u7GOm7aJbK@gnZVwAAAAAA] /index.php?title=Special%3ASearch&search=PM&go=Go Error from line 57 of /app/mediawiki/extensions/CirrusSearch/includes/Search/SearchRequestBuilder.php: Call to undefined method Elastica\Query::setStoredFields()

Backtrace:

#0 /app/mediawiki/extensions/CirrusSearch/includes/Searcher.php(453): CirrusSearch\Search\SearchRequestBuilder->build()
#1 /app/mediawiki/extensions/CirrusSearch/includes/Searcher.php(461): CirrusSearch\Searcher->buildSearch()
#2 /app/mediawiki/extensions/CirrusSearch/includes/Searcher.php(199): CirrusSearch\Searcher->searchOne()
#3 /app/mediawiki/extensions/CirrusSearch/includes/Hooks.php(542): CirrusSearch\Searcher->nearMatchTitleSearch(string)
#4 /app/mediawiki/includes/Hooks.php(177): CirrusSearch\Hooks::onSearchGetNearMatch(string, NULL)
#5 /app/mediawiki/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#6 /app/mediawiki/includes/search/SearchNearMatcher.php(123): Hooks::run(string, array)
#7 /app/mediawiki/includes/search/SearchNearMatcher.php(32): SearchNearMatcher->getNearMatchInternal(string)
#8 /app/mediawiki/includes/specials/SpecialSearch.php(253): SearchNearMatcher->getNearMatch(string)
#9 /app/mediawiki/includes/specials/SpecialSearch.php(143): SpecialSearch->goResult(string)
#10 /app/mediawiki/includes/specialpage/SpecialPage.php(522): SpecialSearch->execute(NULL)
#11 /app/mediawiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#12 /app/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#13 /app/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()
#14 /app/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()
#15 /app/mediawiki/index.php(42): MediaWiki->run()
#16 {main}
MediaWiki	1.31.0
PHP	7.1.8 (apache2handler)
MySQL	5.6.10
ICU	50.1.2
Elasticsearch	5.3.0
Elastica	1.3.0.0 (0959e38) 20:02, 24 October 2016
CirrusSearch	0.2 (c23ae6a) 17:21, 25 October 2016 Legaulph (talk) 18:06, 27 September 2018 (UTC)Reply
Hi, I am getting the same error with the following configuration
!Product
!Version
|-
|MediaWiki
|1.31.1
|-
|PHP
|7.0.25-0ubuntu0.16.04.1 (apache2handler)
|-
|MySQL
|5.7.21-0ubuntu0.16.04.1
|-
|ICU
|55.1
|-
|Elasticsearch
|5.6.1
|-
|Lua
|5.1.5
|}
any ideas? Loman87 (talk) 13:50, 6 November 2018 (UTC)Reply
Hi, I solved uninstalling elastic search, Elastica and CirrusSearch extensions and then following the instructions from the beginning. Everything works now. I guess it could be an issue after upgrading from 1.27.4 to 1.31.1 where another version of elasticsearch is used. Loman87 (talk) 08:45, 16 November 2018 (UTC)Reply

PHP 7.2+ requires upgrade to ruflin/elastica 5.3.2 to avoid deprecated call to each()

[edit]
As of the release fo Elastica for MediaWiki 1.31.1, composer.json requires ruflin/elastica 5.3.0. However, that release uses a deprecated call to each(), which PHP 7.2+ catches. ruflin/elastica 5.3.2 has been released which replaces the deprecated call with other logic.
I have locally edited the composer.json file for this extension to update to elastica-5.3.2, and the problem goes away. i recommend all releases of Extension:Elastica which are supported on versions of MediaWiki which support PHP 7.2+ be updated to use ruflin/elastica-5.3.2 or better in composer.json. Chiefgeek157 (talk) 18:31, 9 November 2018 (UTC)Reply
Thank you Chiefgeek157 for sharing this helpful information to us! 2003:A:665:2000:6839:EDE2:6E34:B11B (talk) 15:35, 12 June 2020 (UTC)Reply
Hi, When i using ruflin/elastica 5.3.0 return this error:
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Multi/MultiBuilder.php on line 50
Call Stack
# Time Memory Function Location
1 0.0002 399928 {main}( ) .../index.php:0
2 0.0837 3865912 MediaWiki->run( ) .../index.php:42
3 0.3998 6809384 MediaWiki->doPostOutputShutdown( ) .../MediaWiki.php:557
4 0.3998 6812368 MediaWiki->{closure:/var/www/html/includes/MediaWiki.php:725-732}( ) .../MediaWiki.php:750
5 0.3998 6812368 MediaWiki->restInPeace( ) .../MediaWiki.php:727
6 0.4017 6815648 MediaWiki->triggerJobs( ) .../MediaWiki.php:912
7 0.4019 6817736 MediaWiki->triggerSyncJobs( ) .../MediaWiki.php:988
8 0.4020 6819544 JobRunner->run( ) .../MediaWiki.php:1002
9 0.4136 6926440 JobRunner->executeJob( ) .../JobRunner.php:193
10 0.4138 6926728 CirrusSearch\Job\LinksUpdate->run( ) .../JobRunner.php:296
11 0.4138 6926776 CirrusSearch\Job\LinksUpdate->doJob( ) .../Job.php:99
12 0.4139 6930856 CirrusSearch\Updater->updateFromTitle( ) .../LinksUpdate.php:52
13 0.4228 7108040 CirrusSearch\Updater->updatePages( ) .../Updater.php:83
14 0.4232 7116608 CirrusSearch\Updater->buildDocumentsForPages( ) .../Updater.php:205
15 1.0124 9260872 Hooks::run( ) .../Updater.php:424
16 1.0125 9260872 Hooks::callHook( ) .../Hooks.php:205
17 1.0125 9261648 CirrusSearch\BuildDocument\RedirectsAndIncomingLinks::finishBatch( ) .../Hooks.php:177
18 1.0125 9261760 CirrusSearch\BuildDocument\RedirectsAndIncomingLinks->realFinishBatch( ) .../RedirectsAndIncomingLinks.php:93
19 1.0126 9266168 Elastica\Multi\Search->search( ) .../RedirectsAndIncomingLinks.php:157
20 1.0241 9282720 Elastica\Multi\MultiBuilder->buildMultiResultSet( ) .../Search.php:152
21 1.0241 9282720 Elastica\Multi\MultiBuilder->buildResultSets( ) .../MultiBuilder.php:17
22 1.0241 9283120 each ( ) .../MultiBuilder.php:50
I update to 5.3.2, now search dont return results, nothing.

Using:
MediaWiki 1.31.1
PHP 7.2.10-0ubuntu0.18.04.1 (apache2handler)
MariaDB 10.1.34-MariaDB-0ubuntu0.18.04.1
ICU 60.2
Elasticsearch 5.6.3
Lua 5.1.5
Elasticsearch is running ok, extensions Elastica 1.3.0.0 (9fcf88c) 08:09 11 oct 2018 and CirrusSearch 0.2 (4330942) 21:17 16 oct 2018
curl -s localhost:9200
{
  "name" : "HHS_8mf",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "phiq1MvXRPaSSK5O46vnkQ",
  "version" : {
    "number" : "5.6.3",
    "build_hash" : "1a2f265",
    "build_date" : "2017-10-06T20:33:39.012Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.1"
  },
  "tagline" : "You Know, for Search"
}

Hcpag (talk) 08:27, 6 February 2019 (UTC)Reply
I have the same "deprecated call "error, does updating ruflin/elastica to 5.3.2 require reindexing? How exactly is that done? Spiros71 (talk) 14:49, 30 April 2020 (UTC)Reply

Installing without composer

[edit]

How can I install this without composer, I am thinking that is my problem. I tried manually adding the lib folder to the extension directory, but this doesn't seem to fix it. I am on MediaWiki Version 1.31, with the latest Elastica. Here is my backtrace when trying to access Version special page:

[XAg4JO4UlqXF1vZqMIvoVAAAAAY] /index.php/Special:Version Error from line 87 of /opt/mediawiki/extensions/Elastica/includes/ElasticaConnection.php: Class 'Elastica\Client' not found

Backtrace:

#0 /opt/mediawiki/extensions/Elastica/includes/ElasticaConnection.php(59): ElasticaConnection->getClient()

#1 /opt/mediawiki/extensions/CirrusSearch/includes/Connection.php(129): ElasticaConnection->setConnectTimeout(integer)

#2 /opt/mediawiki/extensions/CirrusSearch/includes/Hooks.php(698): CirrusSearch\Connection->__construct(CirrusSearch\SearchConfig)

#3 /opt/mediawiki/extensions/CirrusSearch/includes/Hooks.php(409): CirrusSearch\Hooks::getConnection()

#4 /opt/mediawiki/includes/Hooks.php(177): CirrusSearch\Hooks::onSoftwareInfo(array)

#5 /opt/mediawiki/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)

#6 /opt/mediawiki/includes/specials/SpecialVersion.php(241): Hooks::run(string, array)

#7 /opt/mediawiki/includes/specials/SpecialVersion.php(139): SpecialVersion::softwareInformation()

#8 /opt/mediawiki/includes/specialpage/SpecialPage.php(522): SpecialVersion->execute(NULL)

#9 /opt/mediawiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)

#10 /opt/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)

#11 /opt/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()

#12 /opt/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()

#13 /opt/mediawiki/index.php(42): MediaWiki->run()

#14 {main} 206.80.128.20 (talk) 20:42, 5 December 2018 (UTC)Reply