Search_phase_execution_error with script_Score n cosine similarity ES 7.15.2

Greetings! I had started with my Elasticsearch journey with 7.10.1 and could successfully run script_score queries with cosine_similarity earlier. But now when I am using 7.15 I get stuck with this error "Elasticsearch.exceptions.RequestError: RequestError(400, 'search_phase_execution_exception', 'runtime error')" even for a trial dataset of 20 records. I am stuck on this for about a week, tried installing and working with earlier versions of ES too. but still same error.
My index mapping:

  "mappings": {
          "properties": {
              "prompt": {
                  "type": "text",
                  "analyzer": "standard",
                  "fields": {
                      "keyword": {"type": "keyword"},
                      "ngrams": {"type": "text", "analyzer": "ngram_analyzer"}
            "cf": {
                "type": "keyword" },
            "entities": {
                "type": "keyword" },
            "keywords": {
                "type": "keyword" },
                "type": "dense_vector","dims":512

My Query:

esq = {"query":{ 
                "source":"cosineSimilarity(params.qv, doc['promptVec'])+1.0",
        } }
    } ```
ERROR: raise HTTP_EXCEPTIONS.get(status_code, TransportError)(

elasticsearch.exceptions.RequestError: RequestError(400, 'parsing_exception', 'unknown query [query]')

I also tried (as debug step) to reduce no of dims to 5 and indexing only 20 records, but the same error persists. Any help is greatly appreciated

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.