I was wondering if it is possible to show the _score returned by elasticsearch.

My query looks like this:

{
    "index": "category",
    "query": {
        "bool": {
            "should": [
                {
                    "more_like_this": {
                        "fields": [
                            "name"
                        ],
                        "like": "{{Query}}",
                        "min_term_freq": 1,
                        "min_doc_freq": 1,
                        "max_query_terms": 25,
                        "minimum_should_match": "50%"
                    }
                },
                {
                    "more_like_this": {
                        "fields": [
                            "name.std"
                        ],
                        "like": "{{Query}}",
                        "min_term_freq": 1,
                        "min_doc_freq": 1,
                        "max_query_terms": 25,
                        "minimum_should_match": "100%"
                    }
                },
                {
                    "more_like_this": {
                        "fields": [
                            "description"
                        ],
                        "like": "{{Query}}",
                        "min_term_freq": 1,
                        "min_doc_freq": 1,
                        "max_query_terms": 200,
                        "minimum_should_match": "75%"
                    }
                }
            ]
        }
    }
}

This is the response from elasticsearch:

{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 42.0,
    "hits" : [
      {
        "_index" : "category",
        "_type" : "_doc",
        "_id" : "42",
        "_score" : 42.0,
        "_source" : {
          "name" : "example",
          "path" : "/example/path/",
          "description" : "stuff and things",
          "root" : 1
        }
      }
    ]
  }
}

It would be very helpful if I could see the _score for each hits.hits. Any help would be appreciated.

The existing ES query runner is in sorry condition. Later this year we will release an improved version that can do what you described.

1 Like

sounds good. Thanks for taking time to respond! cheers

Dang, I need this as well.

Please keep us posted.

Thanks in advance.