Search is returning a search phrase execution exception in a specific index

Hello all,

A new user of elastic search here :slight_smile: Please bear with me.

So I setup an elastic search server with 2 indices and all seems to be running fine until today. On certain search queries to a specific index I am now receiving the following error:

 "type": "search_phase_execution_exception",
  "reason": "all shards failed",

The same query on the other index works just fine. So I did spend a good deal of searching but I can't seem to make out why this is happening. I do realize I am new and may have done something wrong but eager to learn on how to do it right.

The bottom line question is of course, how do I fix this?

Thank you for any insights and your help. I hope I provided all the necessary information.

Roland

Let me show some details about my setup.

ES Server details. This is a single node setup.

{
"name": "ro-search1",
"cluster_name": "ro-search",
"cluster_uuid": "FQ4Z5d_9QiyMh34W4AXxwg",
"version": {
"number": "7.2.0",
"build_flavor": "default",
"build_type": "deb",
"build_hash": "508c38a",
"build_date": "2019-06-20T15:54:18.811730Z",
"build_snapshot": false,
"lucene_version": "8.0.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
  },
  "tagline": "You Know, for Search"
}

The cluster health returns. The status has always been yellow but it is functioning, so I am not sure if something is to be fixed there.

{
"cluster_name": "ro-search",
"status": "yellow",
"timed_out": false,
"number_of_nodes": 1,
"number_of_data_nodes": 1,
"active_primary_shards": 2,
"active_shards": 2,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 2,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 50.0,
"indices": {
    "easydiscuss": {
        "status": "yellow",
        "number_of_shards": 1,
        "number_of_replicas": 1,
        "active_primary_shards": 1,
        "active_shards": 1,
        "relocating_shards": 0,
        "initializing_shards": 0,
        "unassigned_shards": 1,
        "shards": {
            "0": {
                "status": "yellow",
                "primary_active": true,
                "active_shards": 1,
                "relocating_shards": 0,
                "initializing_shards": 0,
                "unassigned_shards": 1
            }
        }
    },
    "content": {
        "status": "yellow",
        "number_of_shards": 1,
        "number_of_replicas": 1,
        "active_primary_shards": 1,
        "active_shards": 1,
        "relocating_shards": 0,
        "initializing_shards": 0,
        "unassigned_shards": 1,
        "shards": {
            "0": {
                "status": "yellow",
                "primary_active": true,
                "active_shards": 1,
                "relocating_shards": 0,
                "initializing_shards": 0,
                "unassigned_shards": 1
            }
        }
    }
}
}

The full error is:

{
"error": {
    "root_cause": [
        {
            "type": "null_pointer_exception",
            "reason": null
        }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
        {
            "shard": 0,
            "index": "easydiscuss",
            "node": "waFyv9EASji5FxWCVjwBRg",
            "reason": {
                "type": "null_pointer_exception",
                "reason": null
            }
        }
    ],
    "caused_by": {
        "type": "null_pointer_exception",
        "reason": null,
        "caused_by": {
            "type": "null_pointer_exception",
            "reason": null
        }
    }
},
"status": 500
}

The logfile is showing me this:

    [2019-07-29T20:21:31,364][DEBUG][o.e.a.s.TransportSearchAction] [ro-search1] [easydiscuss][0], node[waFyv9EASji5FxWCVjwBRg], [P], s[STARTED], a[id=q25ipMFxS5qm8yRNBDUVaA]: Failed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, indices=[easydiscuss], indicesOptions=IndicesOptions[ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=true, ignore_aliases=false, ignore_throttled=true], types=[_doc], routing='null', preference='null', requestCache=null, scroll=null, maxConcurrentShardRequests=0, batchedReduceSize=512, preFilterShardSize=128, allowPartialSearchResults=true, localClusterAlias=null, getOrCreateAbsoluteStartMillis=-1, ccsMinimizeRoundtrips=true, source={"size":1000,"query":{"query_string":{"query":"import images","fields":[],"type":"best_fields","default_operator":"or","max_determinized_states":10000,"enable_position_increments":true,"fuzziness":"AUTO","fuzzy_prefix_length":0,"fuzzy_max_expansions":50,"phrase_slop":0,"analyze_wildcard":false,"escape":false,"auto_generate_synonyms_phrase_query":true,"fuzzy_transpositions":true,"boost":1.0}},"min_score":0.001}}]
org.elasticsearch.transport.RemoteTransportException: [ro-search1][127.0.0.1:9300][indices:data/read/search[phase/query]]
Caused by: org.elasticsearch.search.query.QueryPhaseExecutionException: Query Failed [Failed to execute main query]
        at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:306)