ELASTIC SEARCH->SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures

Hi All,

           I was trying to make the global search work for my crm version 7.7x

when i click on the test in the crm admin->search i get a popup like 'do system indexing'.

I have set up a cron for every five minutes and done indexing

The thing is i am unable to figure out if the

1.indexing is done or not.

2.i am getting SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures

Elastic search is not returning any records in the global search and when i click on the full search icon on global search i get the SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures.

I am in very bad need to fix this and any help would make my day. Tevfik Tümer Lori F 

Regards

Sidhu

  • Take a look at your config.php file and copy the value for the entry labeled 'unique_key.'

    Assuming you are at a machine that should be able to directly access Elasticsearch, open your browser and go to:

    http://{your_elastic_address}:9200/{unique_key}/_status

    That would at least help you take a look at the index to see if it actually indexed.

    I would also recommend that you check the amount of free disk space available on the Elasticsearch servers. You should allocate approximately 2.5 times the size of the Sugar database.

  • Hi Angel Magana

    unique key is 769027ef17559b741fc2b2670e97c

    I have performed a system indexing

    I dont think it has changed as i get the following.

                I get this Result:{"error":"IndexMissingException[[769027ef17559b741fc2b2670e97c] missing]","status":404}.

    When i have ran http://{your_elastic_address}:9200/{unique_key}/_status.

    Regards

    Sidhu

  • My apologies, I noticed I had a typo in the URL I provided earlier. It should be /_stats at the end of the URL, versus /_status

    Also, the newer versions of Sugar use '{unique_key}_shared' as the name, where in the past we only used the unique key value. Thus it should actually be like this:

    http://{your_elastic_address}:9200/{unique_key}_shared/_stats

    Try making those two adjustments and if you get the same error, that would seem to indicate that the index did not get created.

    Sorry for the confusion, I didn't take into account the point about it being 7.7.

  • Hi Angel Magana

                                      I still get the same error,can you please update me what can i do now.i have recenlty upgraded to 7.7.1.0

    Regards

    Sidhu

  • If you recently upgrade to 7.7.x, sugar has change on the elastic search. Offically it supports to use the elastic search server 1.4.4

    If you are using the old version such as 0.9 or 1.0 the indexing won't be process correctly. Please try to call the http://{your_elastic_address}:9200/

    It will return you the elastic search server version.

    If this is the case, you might need to upgrade the elastic search server first.

  • Hi Haiyin Qiu,

                  I have elastic search 1.4.4 and the

    http://{your_elastic_address}:9200/

    return 200

    Regards

    Sidhu

  • Hi Haiyin Qiu,

                                 You mean for version 7.7.1.0 the indexing wont be performed properly.

    Regards

    Sidhu

  • Sidhu,

    I recommend that you truncate the job_queue table in the database, then schedule a new index being sure to delete the existing data when prompted.

    When you schedule the System Index, the records that will be indexed are added to the fts_queue table in the database.  You should see data in this table when you schedule the system index.  

    The next time cron runs, the FTS indexing should occur and you should start seeing fewer rows in the fts_queue table. When the index is complete, the fts_queue table will be empty.  

    Hope this helps,

    Lori

  • Hi  

                          Thank you for your detailed explaination you have made my day.Thank you once again.

    Regards

    Sidhu

  • sidhu sidhu,

    I'm glad it helped!!

    Lori