# Specify the Collate query in Phrase Suggestion

**URL:** <https://discuss.elastic.co/t/specify-the-collate-query-in-phrase-suggestion/109489>\
**Category:** Elasticsearch\
**Created:** [November 28, 2017, 10:35pm UTC](https://discuss.elastic.co/t/specify-the-collate-query-in-phrase-suggestion/109489 "2017-11-28T22:35:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![panfng](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@panfng](https://discuss.elastic.co/u/panfng)\
**Post date:** [November 28, 2017, 10:35pm UTC](https://discuss.elastic.co/t/specify-the-collate-query-in-phrase-suggestion/109489/1 "2017-11-28T22:35:52Z")

</div>

Phase Suggestion can be done in the search api. I wonder if there's a way to reuse the query in search api call for the Collate query.

Thanks!

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 1, 2017, 8:42am UTC](https://discuss.elastic.co/t/specify-the-collate-query-in-phrase-suggestion/109489/2 "2017-12-01T08:42:55Z")

</div>

Hey,

I am not sure, what you mean with reuse here. You have to specify the query manually, wherever you want to place it.

--Alex

---

<div class="post-metadata">

**Author:** ![panfng](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@panfng](https://discuss.elastic.co/u/panfng)\
**Post date:** [December 7, 2017, 4:06am UTC](https://discuss.elastic.co/t/specify-the-collate-query-in-phrase-suggestion/109489/3 "2017-12-07T04:06:28Z")

</div>

Hi Alexander,  
I got it now. Thank you! Also is there a way to say only give me suggestion if the total number of documents returned is less than a number?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 7, 2017, 7:50am UTC](https://discuss.elastic.co/t/specify-the-collate-query-in-phrase-suggestion/109489/4 "2017-12-07T07:50:48Z")

</div>

nothing on top of my head, that would allow you to do this, as the option only checks if there is a match. Only way is to improve the query to be more strict what it returns.

---

<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:** [January 4, 2018, 7:51am UTC](https://discuss.elastic.co/t/specify-the-collate-query-in-phrase-suggestion/109489/5 "2018-01-04T07:51:19Z")

</div>

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