- Universal
- 4
- Yes, and one of them seems to be triggering the error.
I did some troubleshooting with the Search Explain API, which returns the following query for gjennomføring av byutvikling
:
{
"query": {
"bool": {
"must": {
"function_score": {
"boost_mode": "sum",
"score_mode": "sum",
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"multi_match": {
"query": "gjennomføring av byutvikling",
"minimum_should_match": "3<-1 3<75%",
"type": "cross_fields",
"fields": [
"plaintext^1.0",
"plaintext.stem^0.95",
"plaintext.prefix^0.1",
"plaintext.joined^0.75",
"plaintext.delimiter^0.4",
"abstract^2.0",
"abstract.stem^1.9",
"abstract.prefix^0.2",
"abstract.joined^1.5",
"abstract.delimiter^0.8",
"title^5.0",
"title.stem^4.75",
"title.prefix^0.5",
"title.joined^3.75",
"title.delimiter^2.0",
"actors^2.0",
"actors.stem^1.9",
"actors.prefix^0.2",
"actors.joined^1.5",
"actors.delimiter^0.8",
"publication_year^3.5",
"publication_year.stem^3.325",
"publication_year.prefix^0.35",
"publication_year.joined^2.625",
"publication_year.delimiter^1.4",
"subtitle^2.0",
"subtitle.stem^1.9",
"subtitle.prefix^0.2",
"subtitle.joined^1.5",
"subtitle.delimiter^0.8",
"topic^3.0",
"topic.stem^2.85",
"topic.prefix^0.3",
"topic.joined^2.25",
"topic.delimiter^1.2",
"authors^2.0",
"authors.stem^1.9",
"authors.prefix^0.2",
"authors.joined^1.5",
"authors.delimiter^0.8",
"id^1.0"
]
}
},
{
"multi_match": {
"query": "gjennomføring av byutvikling",
"minimum_should_match": "3<-1 3<75%",
"type": "best_fields",
"fuzziness": "AUTO",
"prefix_length": 2,
"fields": [
"plaintext.stem^0.1",
"abstract.stem^0.2",
"title.stem^0.5",
"actors.stem^0.2",
"publication_year.stem^0.35",
"subtitle.stem^0.2",
"topic.stem^0.3",
"authors.stem^0.2"
]
}
}
]
}
}
],
"should": [
{
"multi_match": {
"query": "gjennomføring av byutvikling",
"type": "phrase",
"boost": 9,
"slop": 0,
"fields": [
"plaintext.stem^0.95",
"abstract.stem^1.9",
"title.stem^4.75",
"actors.stem^1.9",
"publication_year.stem^3.325",
"subtitle.stem^1.9",
"topic.stem^2.85",
"authors.stem^1.9",
"id^1.0"
]
}
}
]
}
},
"functions": [
{
"script_score": {
"script": {
"source": "Math.max(_score * ((3.0 * (doc.containsKey(\"time_decay.float\") && !doc[\"time_decay.float\"].empty ? doc[\"time_decay.float\"].value : 1))) - _score, 0)"
}
}
}
]
}
}
}
},
"sort": [
{
"_score": "desc"
},
{
"_doc": "desc"
}
],
"highlight": {
"fragment_size": 300,
"type": "plain",
"number_of_fragments": 1,
"order": "score",
"encoder": "html",
"require_field_match": false,
"fields": {
"plaintext.stem": {
"fragment_size": 150
},
"plaintext.prefix": {
"fragment_size": 150
}
},
"highlight_query": {
"multi_match": {
"query": "gjennomføring av byutvikling",
"fields": [
"plaintext.stem",
"plaintext.prefix"
]
}
}
},
"size": 10,
"from": 0,
"timeout": "30000ms",
"_source": [
"title",
"plaintext",
"id"
]
}
Which again returns the following error from the Elasticsearch search API for App Search endpoint:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "totalTermFreq must be at least docFreq, totalTermFreq: 2688, docFreq: 2692"
},
{
"type": "illegal_argument_exception",
"reason": "totalTermFreq must be at least docFreq, totalTermFreq: 1589, docFreq: 1593"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": ".ent-search-engine-documents-kudos-development",
"node": "5rlj7jwNRcOVNuIURqPYzw",
"reason": {
"type": "illegal_argument_exception",
"reason": "totalTermFreq must be at least docFreq, totalTermFreq: 2688, docFreq: 2692"
}
},
{
"shard": 1,
"index": ".ent-search-engine-documents-kudos-development",
"node": "5rlj7jwNRcOVNuIURqPYzw",
"reason": {
"type": "illegal_argument_exception",
"reason": "totalTermFreq must be at least docFreq, totalTermFreq: 1589, docFreq: 1593"
}
}
],
"caused_by": {
"type": "illegal_argument_exception",
"reason": "totalTermFreq must be at least docFreq, totalTermFreq: 2688, docFreq: 2692",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "totalTermFreq must be at least docFreq, totalTermFreq: 2688, docFreq: 2692"
}
}
},
"status": 400
}