Topic on Project:Support desk

Elastica\Exception\Connection\HttpException from line 187...\Http.php: Couldn't connect to host, Elasticsearch down?

11
Bruceillest (talkcontribs)
Product Version
MediaWiki 1.32.0
PHP 7.2.7 (cgi-fcgi)
MySQL 8.0.15
ICU 61.1
CirrusSearch 0.2 (b1fa4bd)06:47, 20 February 2019 GPL-2.0-or-later
Elastica 1.3.0.0 (9fcf88c)02:09, 11 October 2018 GPL-2.0-or-later

I tried to run the commands in the read me and it just states that elasticsearch is down. I've tried to connect using curl localhost:9200 and all it gives me is "curl: (7) Failed to connect to localhost port 9200: Connection refused". I ran a netstat and didn't see port 9200 I've also rebooted and don't have any firewalls running. Is there a way to start the elasticsearch service with this setup? This is the first time installing CirrusSearch and Elastica.

MarkAHershberger (talkcontribs)

Try sudo systemctl start elasticsearch. If that works--if there is no error and curl is giving you results--then systemctl can be used to enable it so it starts at boot. To do that, try sudo systemctl enable elasticsearch.

Let us know of any problems.

Bruceillest (talkcontribs)

Mark, thanks for your response but I forgot to mention I am running all of this in Windows server 2012R2. There is no elasticsearch service installed in Windows its only the Elastica extension folder. Is there a batch file or php file I have to run to start it?

MarkAHershberger (talkcontribs)

That does make a difference!

You'll need to install ElasticSearch and make sure it is running. MediaWiki will communicate with it to do the searching.

Bruceillest (talkcontribs)

Awesome I'm making progress but now I'm getting this error.

Elastica\Exception\ResponseException from line 179 of C:\inetpub\wwwroot\CAS\extensions\Elastica\vendor\ruflin\elastica\lib\Elastica\Transport\Http.php: Root mapping definition has unsupported parameters:  [mw_cirrus_metastore : {dynamic=false, properties={mediawiki_version={type=keyword}, mapping_min={type=long}, analysis_maj={type=long}, cirrus_commit={type=keyword}, mapping_maj={type=long}, wiki={type=keyword}, shard_count={type=long}, type={type=keyword}, index_name={type=keyword}, mediawiki_commit={type=keyword}, analysis_min={type=long}, namespace_name={norms=false, analyzer=near_match_asciifolding, type=text, index_options=docs}}}] [reason: Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [mw_cirrus_metastore: {dynamic=false, properties={mediawiki_version={type=keyword}, mapping_min={type=long}, analysis_maj={type=long}, cirrus_commit={type=keyword}, mapping_maj={type=long}, wiki={type=keyword}, shard_count={type=long}, type={type=keyword}, index_name={type=keyword}, mediawiki_commit={type=keyword}, analysis_min={type=long}, namespace_name={norms=false, analyzer=near_match_asciifolding, type=text, index_options=docs}}}]]


I installed Elasticsearch v7.2.0 is this issue due to the version I'm using?

MarkAHershberger (talkcontribs)

Yes, you need Elasticsearch 5.5.x or 5.6.x as the CirrusSearch page says.

Bruceillest (talkcontribs)

Yep sorry about that I noticed that late. So I installed elasticsearch and was able to run all the commands apparently well but when I search for a page it won't populate. I added "&action=cirrusDump" on pages that show up and don't show up on search and the ones that show up have text information and the searches that don't show up have no text information. I'm guessing some pages are indexing and others aren't so I ran updateSearchIndexConfig.php --reindexAndRemoveOk --indexIdentifier=now and forceSearchIndex.php and still no dice. I ended up installing elasticsearch 5.6.0.


Also when I ran forceSearchIndex.php --skipLinks --indexOnSkip and forceSearchIndex.php --skipParse commands I didn't get an output which I was wondering if that's normal.

MarkAHershberger (talkcontribs)

Does it populate your index even though it isn't printing?

Bruceillest (talkcontribs)

How can I tell if it populates my index?


Bruceillest (talkcontribs)

This is the output I get when I run

C:\Windows\system32>curl localhost:9200/_cat/indices?v

health status index                      uuid                    pri rep docs.count docs.deleted store.size pri.store.size

green  open   mw_cirrus_metastore_first  U05k9IpgRTyliejRcCPbcw    1    0          21           18      18.3kb         18.3kb

green  open   caswiki_general_1563218277 fO7-X4mmTAGDn-JY0jleNA   4    0          0            0        648b            648b

green  open   caswiki_content_1563218273 bns-287uS36967cO13eY9g    4    0          9            0    652.2kb        652.2kb

green  open   .tasks                      KX7oUmTUSui9XV5NIfqhlA   1    0          0            0        191b            191b


I have around 244 pages created with a lot of content so I guessing these numbers should be more.

MarkAHershberger (talkcontribs)

I really don't know that much about ElasticSearch. When I said "does it populate your index?" I meant, "can you find pages via searching? If so, your index is probably being populated."

Reply to "Elastica\Exception\Connection\HttpException from line 187...\Http.php: Couldn't connect to host, Elasticsearch down?"