Hi,

We upgraded to Elasticsearch 5.1.2 a little while ago, and are finally getting around to updating our indexes. The 5.0 C# driver informs us that ".String" in mappings is now obsolete, and so we're now using ".Text"

Unfortunately, simply changing what we had from .String to .Text doesn't seem to suffice as our query no longer works. I've been pulling my hair out trying to find out why, searching, etc. but I can't seem to figure out what's wrong or find a solution.

As json, a sample document might be:

{
"description" : {
"fullLength" : 35,
"text" : "This is an example."
},
"tags" : [{
"groupName" : "a",
"text" : "hello",
"type" : "Group"
}
]
}

The mapping is as follows:

{
"threads-v3" : {
"mappings" : {
"thread" : {
"properties" : {
"tags" : {
"type" : "nested",
"include_in_parent" : true,
"properties" : {
"groupName" : {
"type" : "text"
},
"text" : {
"type" : "text",
"index" : false,
"fields" : {
"keyword" : {
"type" : "text",
"analyzer" : "tag_keyword"
}
}
},
"type" : {
"type" : "text"
},
"userId" : {
"type" : "text"
}
}
},
"description" : {
"type" : "nested",
"properties" : {
"fullLength" : {
"type" : "float",
"index" : false
},
"text" : {
"type" : "text",
"fields" : {
"en_search" : {
"type" : "text",
"analyzer" : "english"
},
"ja_search" : {
"type" : "text",
"analyzer" : "ja"
}
}
}
}
}
}
}
}
}
}

And one of the erroring queries is this:

# ServerError: ServerError: 400Type: search_phase_execution_exception Reason: "all shards failed" CausedBy: "Type: query_shard_exception Reason: "failed to create query: {
 "bool" : {
"must" : [
 {
"nested" : {
 "query" : {
"bool" : {
 "must" : [
{
 "match" : {
"tags.text.keyword" : {
 "query" : "test",
 "operator" : "OR",
 "prefix_length" : 0,
 "max_expansions" : 50,
 "fuzzy_transpositions" : true,
 "lenient" : false,
 "zero_terms_query" : "NONE",
 "boost" : 1.0
}
 }
}
 ],
 "filter" : [
{
 "match" : {
"tags.type" : {
 "query" : "Group",
 "operator" : "OR",
 "prefix_length" : 0,
 "max_expansions" : 50,
 "fuzzy_transpositions" : true,
 "lenient" : false,
 "zero_terms_query" : "NONE",
 "boost" : 1.0
}
 }
}
 ],
 "disable_coord" : false,
 "adjust_pure_negative" : true,
 "boost" : 1.0
}
 },
 "path" : "tags",
 "ignore_unmapped" : false,
 "score_mode" : "avg",
 "boost" : 1.0
}
 }
],
 {
"bool" : {
 "must" : [
{
 "bool" : {
"must" : [
 {
"match" : {
 "parentType" : {
"query" : "Room",
"operator" : "OR",
"prefix_length" : 0,
"max_expansions" : 50,
"fuzzy_transpositions" : true,
"lenient" : false,
"zero_terms_query" : "NONE",
"boost" : 1.0
 }
}
 },
 {
"match" : {
 "parentId" : {
"query" : "58ca574596839d174c98b4ae",
"operator" : "OR",
"prefix_length" : 0,
"max_expansions" : 50,
"fuzzy_transpositions" : true,
"lenient" : false,
"zero_terms_query" : "NONE",
"boost" : 1.0
 }
}
 }
],
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
 }
},
{
 "range" : {
"updated" : {
 "from" : null,
 "to" : null,
 "include_lower" : true,
 "include_upper" : true,
 "boost" : 1.0
}
 }
}
 ],
 "disable_coord" : false,
 "adjust_pure_negative" : true,
 "boost" : 1.0
}
 }
],
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
 }
}" CausedBy: "Type: illegal_state_exception Reason: "[nested] nested object under path [videoTags] is not of nested type"""

Another failing query is:

# ServerError: ServerError: 400Type: search_phase_execution_exception Reason: "all shards failed" CausedBy: "Type: query_shard_exception Reason: "failed to create query: {
 "bool" : {
"filter" : [
 {
"bool" : {
 "must" : [
{
 "match" : {
"parentType" : {
 "query" : "Room",
 "operator" : "OR",
 "prefix_length" : 0,
 "max_expansions" : 50,
 "fuzzy_transpositions" : true,
 "lenient" : false,
 "zero_terms_query" : "NONE",
 "boost" : 1.0
}
 }
},
{
 "match" : {
"parentId" : {
 "query" : "58ca574596839d174c98b4ae",
 "operator" : "OR",
 "prefix_length" : 0,
 "max_expansions" : 50,
 "fuzzy_transpositions" : true,
 "lenient" : false,
 "zero_terms_query" : "NONE",
 "boost" : 1.0
}
 }
}
 ],
 "disable_coord" : false,
 "adjust_pure_negative" : true,
 "boost" : 1.0
}
 }
],
"should" : [
 {
"multi_match" : {
 "query" : " a",
 "fields" : [
"title.en_search^1.0",
"title.ja_search^1.0"
 ],
 "type" : "most_fields",
 "operator" : "OR",
 "slop" : 0,
 "prefix_length" : 0,
 "max_expansions" : 50,
 "lenient" : false,
 "zero_terms_query" : "NONE",
 "boost" : 4.0
}
 },
 {
"nested" : {
 "query" : {
"multi_match" : {
 "query" : " a",
 "fields" : [
"description.text.en_search^1.0",
"description.text.ja_search^1.0"
 ],
 "type" : "most_fields",
 "operator" : "OR",
 "slop" : 0,
 "prefix_length" : 0,
 "max_expansions" : 50,
 "lenient" : false,
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB