我正在使用Elasticsearch来索引我的jobvacancy集合。我在我的生产服务器(V4.10.4)和我的宅基流浪盒(V4.10.4)上运行它。
这两个服务器都使用相同的代码来构建索引。
但是,在运行查询时,它会在我的开发框中返回一个有效的空响应,并在我的生产环境中返回一个无效的查询响应。
CURL请求
curl -X POST -H "Cache-Control: no-cache" 'http://localhost:9200/jobs/job/_search' -d '{
"sort": {
"networks.start": {
"order": "desc",
"mode": "max",
"nested_filter": {
"term": {
"networks.id": 10
}
}
}
},
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*Manager*",
"fields": [
"name^2",
"text",
"description",
"company_name^2"
],
"default_operator": "AND"
}
},
{
"query_string": {
"query": "*Manager*",
"fields": [
"name^2",
"text",
"description",
"company_name^2"
],
"default_operator": "AND"
}
},
{
"match": {
"segments": "BXnGVL2o"
}
},
{
"match": {
"segments": "dpjdEZ3R"
}
},
{
"match": {
"segments": "vrLORZ0E"
}
},
{
"match": {
"segments": "GkLe1Lp5"
}
},
{
"match": {
"segments": "0zjrvjYW"
}
},
{
"match": {
"segments": "vRnpPny1"
}
}
]
}
},
"filter": {
"and": [
{
"nested": {
"path": "networks",
"filter": {
"bool": {
"must": [
{
"term": {
"networks.id": 10
}
},
{
"term": {
"networks.status.raw": "PRODUCTION"
}
},
{
"range": {
"networks.start": {
"lte": "now"
}
}
},
{
"range": {
"networks.end": {
"gte": "now"
}
}
},
{
"range": {
"networks.start": {
"gte": "2015-10-04"
}
}
}
]
}
}
}
}
]
}
}
},
"aggs": {
"category_main": {
"terms": {
"field": "category_id"
}
},
"categories": {
"terms": {
"field": "categories"
}
},
"segments": {
"terms": {
"field": "segments"
}
},
"max_salary": {
"max": {
"field": "salary"
}
},
"min_salary": {
"min": {
"field": "salary"
}
}
},
"size": 10,
"from": 0
}'
对发展的回应
{
"took": 12,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
},
"aggregations": {
"min_salary": {
"value": null
},
"segments": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
},
"max_salary": {
"value": null
},
"category_main": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
},
"categories": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
}
}
}
生产响应
{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[MaoAOhMzQnCtHsNCUW3PIQ][jobs][0]: SearchParseException[[jobs][0]: from[-1],size[-1],sort[<custom:\"networks.start\": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@5c9703f2>!]: Parse Failure [Failed to parse source [{\"sort\":{\"networks.start\":{\"order\":\"desc\",\"mode\":\"max\",\"nested_filter\":{\"term\":{\"networks.id\":10}}}},\"query\":{\"filtered\":{\"query\":{\"bool\":{\"must\":[{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"match\":{\"segments\":\"BXnGVL2o\"}},{\"match\":{\"segments\":\"dpjdEZ3R\"}},{\"match\":{\"segments\":\"vrLORZ0E\"}},{\"match\":{\"segments\":\"GkLe1Lp5\"}},{\"match\":{\"segments\":\"0zjrvjYW\"}},{\"match\":{\"segments\":\"vRnpPny1\"}}]}},\"filter\":{\"and\":[{\"nested\":{\"path\":\"networks\",\"filter\":{\"bool\":{\"must\":[{\"term\":{\"networks.id\":10}},{\"term\":{\"networks.status.raw\":\"PRODUCTION\"}},{\"range\":{\"networks.start\":{\"lte\":\"now\"}}},{\"range\":{\"networks.end\":{\"gte\":\"now\"}}},{\"range\":{\"networks.start\":{\"gte\":\"2015-10-04\"}}}]}}}}]}}},\"aggs\":{\"category_main\":{\"terms\":{\"field\":\"category_id\"}},\"categories\":{\"terms\":{\"field\":\"categories\"}},\"segments\":{\"terms\":{\"field\":\"segments\"}},\"max_salary\":{\"max\":{\"field\":\"salary\"}},\"min_salary\":{\"min\":{\"field\":\"salary\"}}},\"size\":10,\"from\":0}]]]; nested: NumberFormatException[For input string: \"BXnGVL2o\"]; }{[MaoAOhMzQnCtHsNCUW3PIQ][jobs][1]: SearchParseException[[jobs][1]: from[-1],size[-1],sort[<custom:\"networks.start\": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@3e84345b>!]: Parse Failure [Failed to parse source [{\"sort\":{\"networks.start\":{\"order\":\"desc\",\"mode\":\"max\",\"nested_filter\":{\"term\":{\"networks.id\":10}}}},\"query\":{\"filtered\":{\"query\":{\"bool\":{\"must\":[{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"match\":{\"segments\":\"BXnGVL2o\"}},{\"match\":{\"segments\":\"dpjdEZ3R\"}},{\"match\":{\"segments\":\"vrLORZ0E\"}},{\"match\":{\"segments\":\"GkLe1Lp5\"}},{\"match\":{\"segments\":\"0zjrvjYW\"}},{\"match\":{\"segments\":\"vRnpPny1\"}}]}},\"filter\":{\"and\":[{\"nested\":{\"path\":\"networks\",\"filter\":{\"bool\":{\"must\":[{\"term\":{\"networks.id\":10}},{\"term\":{\"networks.status.raw\":\"PRODUCTION\"}},{\"range\":{\"networks.start\":{\"lte\":\"now\"}}},{\"range\":{\"networks.end\":{\"gte\":\"now\"}}},{\"range\":{\"networks.start\":{\"gte\":\"2015-10-04\"}}}]}}}}]}}},\"aggs\":{\"category_main\":{\"terms\":{\"field\":\"category_id\"}},\"categories\":{\"terms\":{\"field\":\"categories\"}},\"segments\":{\"terms\":{\"field\":\"segments\"}},\"max_salary\":{\"max\":{\"field\":\"salary\"}},\"min_salary\":{\"min\":{\"field\":\"salary\"}}},\"size\":10,\"from\":0}]]]; nested: NumberFormatException[For input string: \"BXnGVL2o\"]; }{[MaoAOhMzQnCtHsNCUW3PIQ][jobs][2]: SearchParseException[[jobs][2]: from[-1],size[-1],sort[<custom:\"networks.start\": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@522f0274>!]: Parse Failure [Failed to parse source [{\"sort\":{\"networks.start\":{\"order\":\"desc\",\"mode\":\"max\",\"nested_filter\":{\"term\":{\"networks.id\":10}}}},\"query\":{\"filtered\":{\"query\":{\"bool\":{\"must\":[{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"match\":{\"segments\":\"BXnGVL2o\"}},{\"match\":{\"segments\":\"dpjdEZ3R\"}},{\"match\":{\"segments\":\"vrLORZ0E\"}},{\"match\":{\"segments\":\"GkLe1Lp5\"}},{\"match\":{\"segments\":\"0zjrvjYW\"}},{\"match\":{\"segments\":\"vRnpPny1\"}}]}},\"filter\":{\"and\":[{\"nested\":{\"path\":\"networks\",\"filter\":{\"bool\":{\"must\":[{\"term\":{\"networks.id\":10}},{\"term\":{\"networks.status.raw\":\"PRODUCTION\"}},{\"range\":{\"networks.start\":{\"lte\":\"now\"}}},{\"range\":{\"networks.end\":{\"gte\":\"now\"}}},{\"range\":{\"networks.start\":{\"gte\":\"2015-10-04\"}}}]}}}}]}}},\"aggs\":{\"category_main\":{\"terms\":{\"field\":\"category_id\"}},\"categories\":{\"terms\":{\"field\":\"categories\"}},\"segments\":{\"terms\":{\"field\":\"segments\"}},\"max_salary\":{\"max\":{\"field\":\"salary\"}},\"min_salary\":{\"min\":{\"field\":\"salary\"}}},\"size\":10,\"from\":0}]]]; nested: NumberFormatException[For input string: \"BXnGVL2o\"]; }{[MaoAOhMzQnCtHsNCUW3PIQ][jobs][3]: SearchParseException[[jobs][3]: from[-1],size[-1],sort[<custom:\"networks.start\": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@c4a37d3>!]: Parse Failure [Failed to parse source [{\"sort\":{\"networks.start\":{\"order\":\"desc\",\"mode\":\"max\",\"nested_filter\":{\"term\":{\"networks.id\":10}}}},\"query\":{\"filtered\":{\"query\":{\"bool\":{\"must\":[{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"match\":{\"segments\":\"BXnGVL2o\"}},{\"match\":{\"segments\":\"dpjdEZ3R\"}},{\"match\":{\"segments\":\"vrLORZ0E\"}},{\"match\":{\"segments\":\"GkLe1Lp5\"}},{\"match\":{\"segments\":\"0zjrvjYW\"}},{\"match\":{\"segments\":\"vRnpPny1\"}}]}},\"filter\":{\"and\":[{\"nested\":{\"path\":\"networks\",\"filter\":{\"bool\":{\"must\":[{\"term\":{\"networks.id\":10}},{\"term\":{\"networks.status.raw\":\"PRODUCTION\"}},{\"range\":{\"networks.start\":{\"lte\":\"now\"}}},{\"range\":{\"networks.end\":{\"gte\":\"now\"}}},{\"range\":{\"networks.start\":{\"gte\":\"2015-10-04\"}}}]}}}}]}}},\"aggs\":{\"category_main\":{\"terms\":{\"field\":\"category_id\"}},\"categories\":{\"terms\":{\"field\":\"categories\"}},\"segments\":{\"terms\":{\"field\":\"segments\"}},\"max_salary\":{\"max\":{\"field\":\"salary\"}},\"min_salary\":{\"min\":{\"field\":\"salary\"}}},\"size\":10,\"from\":0}]]]; nested: NumberFormatException[For input string: \"BXnGVL2o\"]; }{[MaoAOhMzQnCtHsNCUW3PIQ][jobs][4]: SearchParseException[[jobs][4]: from[-1],size[-1],sort[<custom:\"networks.start\": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@c4a37d3>!]: Parse Failure [Failed to parse source [{\"sort\":{\"networks.start\":{\"order\":\"desc\",\"mode\":\"max\",\"nested_filter\":{\"term\":{\"networks.id\":10}}}},\"query\":{\"filtered\":{\"query\":{\"bool\":{\"must\":[{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"query_string\":{\"query\":\"*Manager*\",\"fields\":[\"name^2\",\"text\",\"description\",\"company_name^2\"],\"default_operator\":\"AND\"}},{\"match\":{\"segments\":\"BXnGVL2o\"}},{\"match\":{\"segments\":\"dpjdEZ3R\"}},{\"match\":{\"segments\":\"vrLORZ0E\"}},{\"match\":{\"segments\":\"GkLe1Lp5\"}},{\"match\":{\"segments\":\"0zjrvjYW\"}},{\"match\":{\"segments\":\"vRnpPny1\"}}]}},\"filter\":{\"and\":[{\"nested\":{\"path\":\"networks\",\"filter\":{\"bool\":{\"must\":[{\"term\":{\"networks.id\":10}},{\"term\":{\"networks.status.raw\":\"PRODUCTION\"}},{\"range\":{\"networks.start\":{\"lte\":\"now\"}}},{\"range\":{\"networks.end\":{\"gte\":\"now\"}}},{\"range\":{\"networks.start\":{\"gte\":\"2015-10-04\"}}}]}}}}]}}},\"aggs\":{\"category_main\":{\"terms\":{\"field\":\"category_id\"}},\"categories\":{\"terms\":{\"field\":\"categories\"}},\"segments\":{\"terms\":{\"field\":\"segments\"}},\"max_salary\":{\"max\":{\"field\":\"salary\"}},\"min_salary\":{\"min\":{\"field\":\"salary\"}}},\"size\":10,\"from\":0}]]]; nested: NumberFormatException[For input string: \"BXnGVL2o\"]; }]",
"status": 400
}
有没有人知道这个问题会怎么发生?谢谢,