# Make collate score count for suggest candidates rank

**URL:** <https://discuss.elastic.co/t/make-collate-score-count-for-suggest-candidates-rank/86985>\
**Category:** Elasticsearch\
**Created:** [May 24, 2017, 1:40pm UTC](https://discuss.elastic.co/t/make-collate-score-count-for-suggest-candidates-rank/86985 "2017-05-24T13:40:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [May 24, 2017, 1:40pm UTC](https://discuss.elastic.co/t/make-collate-score-count-for-suggest-candidates-rank/86985/1 "2017-05-24T13:40:07Z")

</div>

elasticsearch 2.4

We use phrase suggester against 10 millions doc, extract of suggest part from our search template :

```
"suggest": {
         "spellchecker": {
            "text": "{{my_query}}",
            "phrase": {
               "field": "{{field_name}}",
               "confidence": 1,
               "size": 5,
               "max_errors": 3,
               "highlight": {
                  "pre_tag": "<b>",
                  "post_tag": "</b>"
               },
               "direct_generator": [
                  {
                     "field": "{{field_name}}",
                     "suggest_mode": "always",
                     "prefix_length": 0,
                     "min_word_length": 1,
					 "min_doc_freq" : 200,
                     "string_distance": "damerau_levenshtein"
                  }
               ],
               "collate": {
                  "query": {
                     "inline": {
                        "match_phrase": {
                           "{{field_name}}": "{{=<% %>=}}{{suggestion}}<%={{ }}=%>"
                        }
                     }
                  },
                  "prune": false
               }
            }
         }
    },    

```

but it seems for 30% of cases, it select candidates that dont match better the collate query (which is for us, a simple match\_phrase query).

So now we run the match queries after and select the highest score , for all candidates, and found this is very good .

My question is, is it possible that collate query score count for candidate ranking ?

(Sorry, I didnt manage to reproduce it with a simple example).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 21, 2017, 1:40pm UTC](https://discuss.elastic.co/t/make-collate-score-count-for-suggest-candidates-rank/86985/2 "2017-06-21T13:40:10Z")

</div>

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