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
- 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+command

- Importance
- 5
- Easy to solve?
- 6
- Priority
- 30
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 6180
- Created
- Friday 18 November, 2016 19:01:02 UTC
by Nelson Ko - LastModif
- Saturday 24 June, 2017 12:27:50 UTC