We are trying to move from ES 6.8 to ES 7.17. On an ES query we are getting the following error (the same query was working fine in ES 6.8):
When I try Kibana also, I get the same error:
"root_cause": [
{
"type": "query_shard_exception",
"reason": "failed to create query: Score function should not be null",
"index_uuid": "wJbAGA__Sgil2pVHvgD6IA",
"index": "code_sourcenodedupefilecontractv3_1421_shared"
}
=========================
Any suggestions will be very helpful.
Full query and exception below -
- Query:
=========
GET code_sourcenodedupefilecontractv3_1421_shared/_search
{
"query": {
"bool": {
"must": {
"bool": {
"should": [
{
"codesearch_score_query": {
"query_id": "dd212257-556a-4d47-8143-0972c10718f4",
"query": {
"term": {
"content": "class"
}
}
}
},
{
"function_score": {
"boost": 10000000,
"query": {
"term": {
"fileName": {
"value": "class",
"_name": "fileName_class"
}
}
}
}
}
]
}
},
"filter": {
"bool": {
"must": [
{
"bool": {
"must": [
{
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"terms": {
"vcType": [
"git"
]
}
}
],
"must_not": [
{
"terms": {
"repositoryId": [
"d25b2a5f-76fc-4fb9-a09f-4a19124213e4"
]
}
}
]
}
},
{
"terms": {
"vcType": [
"tfvc"
]
}
}
]
}
},
{
"terms": {
"vcType": [
"custom"
]
}
}
]
}
},
{
"term": {
"isDefaultBranch": "true"
}
}
]
}
},
{
"bool": {
"filter": {
"terms": {
"projectId": [
"eac210c4-399e-419a-9909-691014e475c1"
],
"_name": "projectId_eac210c4-399e-419a-9909-691014e475c1"
}
}
}
}
]
}
},
{
"term": {
"collectionId": "fd4f94ce-d825-408c-9a68-0ce5ecd544da"
}
}
]
}
}
}
}
}
==============================================================
==============================================================
2. Error Message:
{
"error": {
"root_cause": [
{
"type": "query_shard_exception",
"reason": "failed to create query: Score function should not be null",
"index_uuid": "wJbAGA__Sgil2pVHvgD6IA",
"index": "code_sourcenodedupefilecontractv3_1421_shared"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "code_sourcenodedupefilecontractv3_1421_shared",
"node": "eDb-Xyx_RJOgcPLmErF8Ww",
"reason": {
"type": "query_shard_exception",
"reason": "failed to create query: Score function should not be null",
"index_uuid": "wJbAGA__Sgil2pVHvgD6IA",
"index": "code_sourcenodedupefilecontractv3_1421_shared",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Score function should not be null"
}
}
}
]
},
"status": 400
}