Loading...
 
Skip to main content

All shards failed error when using Elasticsearch on pages with LIST plugins and sort_mode set in query string

Status
Open
Subject
All shards failed error when using Elasticsearch on pages with LIST plugins and sort_mode set in query string
Version
15.x
16.x
17.x
Category
  • Error
Feature
Search
Resolution status
New
Submitted by
Nelson Ko
Lastmod by
Nelson Ko, Jonny Bradley
Rating
(0)
Description

Users see an "All shards failed" error/warning feedback when using Elasticsearch on pages with LIST plugins and sort_mode set in query string (by whatever means, either the page's php itself or whatever). It will happen because if the sort_mode is set to something which is invalid for that search query, Elasticsearch will throw an error.

This issue should actually be handled In lib/core/Search/Query.php, as there is already an attempt at gracefully bypassing sort errors in function search(..), but it is not working (prob because of Elasticsearch upgrades). the sort exception is thrown in lib/core/Search/Elastic/Connection.php using a preg_match('/No mapping found for \(\S+)\ in order to sort on/, it could be very likely ElasticSearch changed this. In fact, that whole firing different type of errors need to be reviewed for different version of Elasticsearch.

There is nevertheless a workaround for now even if the above isn't fixed - i.e. if you set a sort_arg variable for each of the LIST plugins on the page it will solve it, as then sort_mode in the query string won't affect these LIST searches. https://doc.tiki.org/LIST+-+list+or+pagination+commandQuestion

Importance
5
Easy to solve?
6
Priority
30
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
6180
Created
Friday 18 November, 2016 19:01:02 UTC
by Nelson Ko
LastModif
Saturday 24 June, 2017 12:27:50 UTC


Show PHP error messages