Closed as not planned
Closed as not planned
Description
The following code will throw an exception: [es/search] failed: [parsing_exception] unknown query [query].
@Query(value = """
{
"query": {
"script_score": {
"query": {
"match_all": {}
},
"script": {
"source": "cosineSimilarity(params.vector, doc['nameVector']) + cosineSimilarity(params.vector, doc['descriptionVector'])",
"params": {
"vector": ?0
}
}
}
},
"sort": [
{ "_score": { "order": "desc" } }
]
}
""")
Flux<SearchHit<ClubPO>> queryClubs(List<Double> vector);
The following code can run successfully.
@Query("""
{
"script_score": {
"query": {
"match_all": {}
},
"script": {
"source": "cosineSimilarity(params.vector, doc['nameVector']) + cosineSimilarity(params.vector, doc['descriptionVector'])",
"params": {
"vector": ?0
}
}
}
}
""")
Flux<SearchHit<ClubPO>> queryClubs(List<Double> vector);
What should I do?
Are there any other annotations? For example, ones that support more raw query syntax?