0

I'm using elasticsearch

{
  "name" : "Angela Cairn",
  "cluster_name" : "prod-elastic",
  "cluster_uuid" : "iKkcI5FwTsGMtXacl3Qg-g",
  "version" : {
    "number" : "2.4.4",
    "build_hash" : "fcbb46dfd45562a9cf00c604b30849a6dec6b017",
    "build_timestamp" : "2017-01-03T11:33:16Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.2"
  },
  "tagline" : "You Know, for Search"
}

sometimes I found below error and I'm not able to find the reason why it happens and what is the solution for same

Error

Failed to execute phase [dfs], all shards failed; shardFailures {[3MNt6HxYSGiyfoZZhB20lw][catalog][0]: RemoteTransportException[[Angela Cairn][172.31.28.194:9300][indices:data/read/search[phase/dfs]]]; nested: SearchParseException[failed to parse search source [{"from":0,"size":15,"query_binary":"eyAiYm9vbCI6ICB7ICJtdXN0X25vdCIgOiBbIHsgICAibWF0Y2giOnsgICAic3RhdHVzIjoiSW5hY3RpdmUifSB9LCB7ICAibWF0Y2giOnsgICAic3RhdHVzIjoiUGVuZGluZyJ9IH1dLCAibXVzdCI6IFt7ICJtYXRjaCI6IHsgImxvY2F0aW9uIjogIkRlbGhpIiB9IH0seyAiYm9vbCI6eyAic2hvdWxkIjogWyB7ICJtdWx0aV9tYXRjaCIgOiB7ICJxdWVyeSI6ICJ0aGlvbmFpZCBcXFxcXFxcXFxcXFxcXFxcXCIsICJ0eXBlIjogImJlc3RfZmllbGRzIiwgImZpZWxkcyI6IFsgIm5hbWVeNSIsICJicmFuZF4zIiBdLCAiYm9vc3QiOjEsICJmdXp6aW5lc3MiIDogIkFVVE8iLCAicHJlZml4X2xlbmd0aCI6IDIgfSB9LCB7ICJtdWx0aV9tYXRjaCIgOiB7ICJxdWVyeSI6ICJ0aGlvbmFpZCBcXFxcXFxcXFxcXFxcXFxcXCIsICJ0eXBlIjogInBocmFzZV9wcmVmaXgiLCAiZmllbGRzIjogWyAibmFtZV41IiwgImJyYW5kXjMiIF0sICJib29zdCI6IDMgfSB9LHsgIm11bHRpX21hdGNoIiA6IHsgInF1ZXJ5IjogInRoaW9uYWlkIFxcXFxcXFxcXFxcXFxcXFxcIiwgInR5cGUiOiAicGhyYXNlX3ByZWZpeCIsICJmaWVsZHMiOiBbICJza3UiIF0sICJib29zdCI6IDUgfSB9XSB9IH1dIH0gfQ=="}]]; nested: QueryParsingException[Failed to parse]; nested: JsonParseException[Unexpected character ('t' (code 116)): was expecting comma to separate Object entries
     at [Source: [B@6f430fbe; line: 1, column: 238]]; }{[3MNt6HxYSGiyfoZZhB20lw][catalog][1]: RemoteTransportException[[Angela Cairn][172.31.28.194:9300][indices:data/read/search[phase/dfs]]]; nested: SearchParseException[failed to parse search source [{"from":0,"size":15,"query_binary":"eyAiYm9vbCI6ICB7ICJtdXN0X25vdCIgOiBbIHsgICAibWF0Y2giOnsgICAic3RhdHVzIjoiSW5hY3RpdmUifSB9LCB7ICAibWF0Y2giOnsgICAic3RhdHVzIjoiUGVuZGluZyJ9IH1dLCAibXVzdCI6IFt7ICJtYXRjaCI6IHsgImxvY2F0aW9uIjogIkRlbGhpIiB9IH0seyAiYm9vbCI6eyAic2hvdWxkIjogWyB7ICJtdWx0aV9tYXRjaCIgOiB7ICJxdWVyeSI6ICJ0aGlvbmFpZCBcXFxcXFxcXFxcXFxcXFxcXCIsICJ0eXBlIjogImJlc3RfZmllbGRzIiwgImZpZWxkcyI6IFsgIm5hbWVeNSIsICJicmFuZF4zIiBdLCAiYm9vc3QiOjEsICJmdXp6aW5lc3MiIDogIkFVVE8iLCAicHJlZml4X2xlbmd0aCI6IDIgfSB9LCB7ICJtdWx0aV9tYXRjaCIgOiB7ICJxdWVyeSI6ICJ0aGlvbmFpZCBcXFxcXFxcXFxcXFxcXFxcXCIsICJ0eXBlIjogInBocmFzZV9wcmVmaXgiLCAiZmllbGRzIjogWyAibmFtZV41IiwgImJyYW5kXjMiIF0sICJib29zdCI6IDMgfSB9LHsgIm11bHRpX21hdGNoIiA6IHsgInF1ZXJ5IjogInRoaW9uYWlkIFxcXFxcXFxcXFxcXFxcXFxcIiwgInR5cGUiOiAicGhyYXNlX3ByZWZpeCIsICJmaWVsZHMiOiBbICJza3UiIF0sICJib29zdCI6IDUgfSB9XSB9IH1dIH0gfQ=="}]]; nested: QueryParsingException[Failed to parse]; nested: JsonParseException[Unexpected character ('t' (code 116)): was expecting comma to separate Object entries
4
  • you see that in the exception? QueryParsingException[Failed to parse]; nested: JsonParseException[Unexpected character ('t' (code 116)): was expecting comma to separate Object entries at [Source: [B@6f430fbe; line: 1, column: 238]]; } Commented Nov 9, 2018 at 7:45
  • yes but i don't know what is the actual issue Commented Nov 9, 2018 at 7:49
  • is it any doc structure issue or something else ? Commented Nov 9, 2018 at 7:50
  • there is any syntax error in a query. You should find the query and fix it. Commented Nov 9, 2018 at 8:04

1 Answer 1

1

The main clue is provided:

QueryParsingException[Failed to parse]; nested: JsonParseException[Unexpected character ('t' (code 116)): was expecting comma to separate Object entries

ElasticSearch is telling you that the query that you're trying to execute is an invalid JSON document.

The said query is this:

{ 
  "bool": { 
    "must_not" : [
      { "match":{ "status":"Inactive"} } ,
      { "match":{ "status":"Pending"} }
    ],
    "must": [
      { "match": { "location": "Delhi" } },
      { "bool": {
        "should": [
        { 
          "multi_match" : { 
            "query": "thionaid \\\\\\\\\\\\\\\\\",
            "type": "best_fields",
            "fields": [ "name^5", "brand^3" ],
            "boost":1,
            "fuzziness" : "AUTO",
            "prefix_length": 2
          }
        },
        { 
          "multi_match" : { 
            "query": "thionaid \\\\\\\\\\\\\\\\\",
            "type": "phrase_prefix",
            "fields": [ "name^5", "brand^3" ],
            "boost": 3
          }
        },
        { 
          "multi_match" : { 
            "query": "thionaid \\\\\\\\\\\\\\\\\",
            "type": "phrase_prefix",
            "fields": [ "sku" ],
            "boost": 5
          }
        }
      ]
    }
  }
  ]
 }
}

The problem is these strings: "thionaid \\\\\\\\\\\\\\\\\" (one too many backslashes)

Sign up to request clarification or add additional context in comments.

2 Comments

thanks, #robert can you please tell me how you got this query
@Devratna that query is written to the error log (as query_binary). It's just a Base64-encoded string containing the query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.