"An error has occurred while searching: We could not complete your search due to a temporary problem. Please try again later."

troubleshooting

#1
  1. Check what went wrong by adding RequestDebug=true to your request.
  2. Search the debug output for CirrusSearch
[CirrusSearchRequests] full_text search for 'foo' against wiki_demo took 7 millis. Requested via web for 4da2275d052902291e8c1a12fc08afc8 by executor 1655307580
[CirrusSearch] Search backend error during full_text search for 'foo' after 7: index_not_found_exception: no such index

If you see an error message like above, then the indexes have not been created yet.

To solve this, place a temporary $wgDisableSearchUpdate = true; in LocalSettings.php and run
WIKI=demo php /opt/htdocs/w/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php to build the indexes. This was instantaneous on the demo server, but could take some time on a large dataset?

You might visit http://wiki.freephile.org:9201/_plugin/head/ and see that everything is “green” with CirrusSearch, but also notice that there are only a couple indexes (not a full set) like the image below:

Immediately upon reindexing, the cluster health for wiki.freephile.org turned yellow with 20 indexes. But at least search doesn’t throw an error. Although it appears to work, the truth is that it either doesn’t have the content indexed yet, or else there is an actual problem because near searches like ‘nematodes’ do not show related content at all.

There is a ton of data in netdata that shows Elasticsearch is definitely working and taking up more resources (compared with essentially zero). Still, the question remains about why content isn’t being suggested.


#2

I actually ran into this problem again, and it seems that it can occur due to insufficient memory on the server (which is a bad thing to do to Elasticsearch). Somehow, the freephile host did NOT have a swap partition. So, I created and enabled a 8GB swap partition.

I also rebuilt the indexes for meta:

/opt/.deploy-meza/elastic-rebuild-all.sh meta

Now elasticsearch is working as can be seen in the cluster health:
http://meta.qualitybox.us:20000/#menu_elasticsearch_local_submenu_cluster_health_API;theme=slate;help=true

I am still in the process of adding monitoring and management of Elasticsearch for 5.x (X-pack and Kibana)