1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Elasticsearch error

Discussion in 'Enhanced Search Support' started by AndyB, Apr 4, 2013.

  1. AndyB

    AndyB Well-Known Member

    Elasticsearch has been working fine for several days since it was installed. Last night I ran the Optimize in ES. This morning ES fails to work and I get a "No results found." when I try to search for anything.

    On the server I can stop and start ES and all indications is that it's running on the server. I see the following errors in my ACP Server Error Log.

    Code:
    XenForo_Exception: Elasticsearch error: SearchPhaseExecutionException[Failed to execute phase [query], total failure; shardFailures {[_na_][xenforo113][2]: No active shards}{[_na_][xenforo113][3]: No active shards}{[_na_][xenforo113][0]: No active shards}{[_na_][xenforo113][1]: No active shards}{[_na_][xenforo113][4]: No active shards}] - library/XenES/Search/SourceHandler/ElasticSearch.php:713
    Generated By: Unknown Account, 25 minutes ago
    
    Code:
    XenForo_Exception: Elasticsearch error: IndexMissingException[[xenforo113] missing] - library/XenES/Search/SourceHandler/ElasticSearch.php:713
    Generated By: [URL='http://www.myforum.com/forums/admin.php?users/1/']Andy[/URL], Monday at 7:15 AM
    
     
  2. Mike

    Mike XenForo Developer Staff Member

    The recent error is essentially saying that ES isn't running. You may need to restart the service, possibly checking into the logs to figure out why there aren't any shards available.

    The first error is what happens if someone tries to search after you've enabled ES in XF but didn't rebuild the search index (or optimize the mappings).
     
  3. AndyB

    AndyB Well-Known Member

    Hi Mike,

    I got it working. Here are my observations.

    Last night when the Elasticsearch Setup page showed Optimize I clicked it, I suspect that messed up the index. This morning (after noticing ES wasn't working) I looked at the Elasticsearch Setup page, I clicked the Delete Index and from what I can tell nothing happened. What fixed the problem was to go to the Rebuild Caches screen and doing a Rebuild Search Index.

    It would be great if the Elasticsearch Setup page would provide an indication if a Search Index existed. So after you delete the Search Index it would show there isn't one and explain that you need to go to the Rebuild Caches page and rebuild your search index cache.
     

    Attached Files:

  4. graham_w

    graham_w Active Member

    When you clicked optimize, didn't that ask you to rebuild the cache ?
     
  5. AndyB

    AndyB Well-Known Member

    I can't remember if there was any message, I do recall that it appeared to do nothing.
     
  6. graham_w

    graham_w Active Member

    Ok - there was a post in another thread saying that when you click optimize it should force you to rebuild as it removes all of the old data. So what you saw was by design.

    Question regarding upgrade of search

     
  7. AndyB

    AndyB Well-Known Member

    Thanks Graham. Yes that's the thread that triggered me to try and optimize. When we optimize a MySQL table it doesn't require rebuilding the index and that's why I thought it would be similar with ES. Clicking Optimize in ES should trigger the index rebuild.
     

Share This Page