Elasticsearch with MLT(more like this) query on document

43 views Asked by At

I am trying to run (MLT) more like this query on my exiting elastic index, the index document structure look like below snap. i have two main question in this regards.

  1. can we run MLT query on non vector field like str, int, or float?
  2. how we convert our exiting text document support to MLT support?

elastic document structure:

{
  "c_ref": 100,"f_ref": 1,"text":"Hi i am sam from oracle"
}

MLT Query:

{
  "query": {
    "more_like_this": {
      "fields": [ "text", "c_ref", "f_ref" ],
      "like": [
        {
          "c_ref": 100,
          "f_ref": 1
        },
        "sam"
      ],
      "min_term_freq": 1,
      "max_query_terms": 12
    }
  }
}


RequestError(400, 'parse_exception', 'failed to parse More Like This item. unknown field [c_ref]')
0

There are 0 answers