# The completion suggester needs n! input combinations?

**URL:** <https://discuss.elastic.co/t/the-completion-suggester-needs-n-input-combinations/14629>\
**Category:** Elasticsearch\
**Created:** [November 28, 2013, 1:23pm UTC](https://discuss.elastic.co/t/the-completion-suggester-needs-n-input-combinations/14629 "2013-11-28T13:23:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karussell\_2](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@Karussell\_2](https://discuss.elastic.co/u/Karussell_2)\
**Post date:** [November 28, 2013, 1:23pm UTC](https://discuss.elastic.co/t/the-completion-suggester-needs-n-input-combinations/14629/1 "2013-11-28T13:23:14Z")

</div>

Hi there,

the completion API looks really nice! There is nearly all I need like  
payloads, weighting etc

But assume the example with the hotels [1]. How would you solve the problem  
that the user can do the input in every possible combination 'Mercure Hotel  
Munich', 'Mercure Munich', 'Munich Mercure', ... ? Should I specify 3_2_1  
input values? What if my input is an address which could consist of 6 terms  
(country, county, town/village, district, zipcode, street) plus POI  
information which can easily lead to over 1000 combinations per entry!?  
Should I better use prefix query or nEdgeGram? Another possibility would be  
the facet workaround [2] but this is not nice as I need to include a  
payload value.

Also highlighting and (geo) filtering is currently not supported, right?

Regards,  
Peter.

[1]

> **[You Complete Me
	  	 | Elastic](https://www.elastic.co/blog/you-complete-me)**
>
> Effective search is not just about returning relevant results when a user types in a search phrase, it's also about helping your user to choose the best search phrases. Elasticsearch already has did-y...

[2]  
[https://groups.google.com/forum/#!searchin/elasticsearch/suggestion/elasticsearch/76VIOu32J9Q/zfwTjYLDocgJ](https://groups.google.com/forum/#!searchin/elasticsearch/suggestion/elasticsearch/76VIOu32J9Q/zfwTjYLDocgJ)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/53ec62bd-d038-451f-8d00-d6377f6e5de2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/53ec62bd-d038-451f-8d00-d6377f6e5de2%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Karussell\_2](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@Karussell\_2](https://discuss.elastic.co/u/Karussell_2)\
**Post date:** [November 29, 2013, 6:49pm UTC](https://discuss.elastic.co/t/the-completion-suggester-needs-n-input-combinations/14629/2 "2013-11-29T18:49:42Z")

</div>

Someone an idea about this?

This is probably not such a big problem with languages having spaces as  
separator. Because you can easily split by space and feed some of the  
combinations. But how should I make sure completion is done properly with  
the other languages like chinese? Why not use a shingle token filter?

Regards,  
Peter.

On Thursday, November 28, 2013 2:23:14 PM UTC+1, Karussell wrote:

> Hi there,
> 
> the completion API looks really nice! There is nearly all I need like  
> payloads, weighting etc
> 
> But assume the example with the hotels [1]. How would you solve the  
> problem that the user can do the input in every possible combination  
> 'Mercure Hotel Munich', 'Mercure Munich', 'Munich Mercure', ... ? Should I  
> specify 3_2_1 input values? What if my input is an address which could  
> consist of 6 terms (country, county, town/village, district, zipcode,  
> street) plus POI information which can easily lead to over 1000  
> combinations per entry!? Should I better use prefix query or nEdgeGram?  
> Another possibility would be the facet workaround [2] but this is not nice  
> as I need to include a payload value.
> 
> Also highlighting and (geo) filtering is currently not supported, right?
> 
> Regards,  
> Peter.
> 
> [1]  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)
> 
> [2]
> 
> [Redirecting to Google Groups](https://groups.google.com/forum/#!searchin/elasticsearch/suggestion/elasticsearch/76VIOu32J9Q/zfwTjYLDocgJ)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/79f5dcdb-b8f9-4a90-9f45-8dfacb9f94cf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/79f5dcdb-b8f9-4a90-9f45-8dfacb9f94cf%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [November 29, 2013, 9:42pm UTC](https://discuss.elastic.co/t/the-completion-suggester-needs-n-input-combinations/14629/3 "2013-11-29T21:42:52Z")

</div>

we will likely add other suggesters that solve the infix problem. In a lot  
of cases this suggester solves problems very efficiently and I don't think  
we should advertise to use combinatorial inputs since they require  
different handling on the algorithmic side. There is stuff in the pipeline  
that helps here but I don't think we can just throw shingles against it and  
it will work. I experimented with it but it can quickly explode which is  
another thing we need to take care of. I agree we need to make the  
interface better and for freetext this one will not work at this point but  
I don't think this is it's purpose.

simon

On Friday, November 29, 2013 7:49:42 PM UTC+1, Karussell wrote:

> Someone an idea about this?
> 
> This is probably not such a big problem with languages having spaces as  
> separator. Because you can easily split by space and feed some of the  
> combinations. But how should I make sure completion is done properly with  
> the other languages like chinese? Why not use a shingle token filter?
> 
> Regards,  
> Peter.
> 
> On Thursday, November 28, 2013 2:23:14 PM UTC+1, Karussell wrote:
> 
> > Hi there,
> > 
> > the completion API looks really nice! There is nearly all I need like  
> > payloads, weighting etc
> > 
> > But assume the example with the hotels [1]. How would you solve the  
> > problem that the user can do the input in every possible combination  
> > 'Mercure Hotel Munich', 'Mercure Munich', 'Munich Mercure', ... ? Should I  
> > specify 3_2_1 input values? What if my input is an address which could  
> > consist of 6 terms (country, county, town/village, district, zipcode,  
> > street) plus POI information which can easily lead to over 1000  
> > combinations per entry!? Should I better use prefix query or nEdgeGram?  
> > Another possibility would be the facet workaround [2] but this is not nice  
> > as I need to include a payload value.
> > 
> > Also highlighting and (geo) filtering is currently not supported, right?
> > 
> > Regards,  
> > Peter.
> > 
> > [1]  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)
> > 
> > [2]
> > 
> > [Redirecting to Google Groups](https://groups.google.com/forum/#!searchin/elasticsearch/suggestion/elasticsearch/76VIOu32J9Q/zfwTjYLDocgJ)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/35b18b38-a488-4375-aab8-5d373701ea11%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/35b18b38-a488-4375-aab8-5d373701ea11%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Karussell\_2](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@Karussell\_2](https://discuss.elastic.co/u/Karussell_2)\
**Post date:** [December 1, 2013, 10:41am UTC](https://discuss.elastic.co/t/the-completion-suggester-needs-n-input-combinations/14629/4 "2013-12-01T10:41:17Z")

</div>

Thanks Simon,

I've actually relative good results with a normal search combined with a  
prefix stuff. It looks like this is also very fast and additionally I can  
apply filters, plus: the suggestions give nearly identical results like the  
normal search.

I'll keep you informed with limitations of my approach 😉 !

Regards,  
Peter.

On Friday, November 29, 2013 10:42:52 PM UTC+1, simonw wrote:

> we will likely add other suggesters that solve the infix problem. In a lot  
> of cases this suggester solves problems very efficiently and I don't think  
> we should advertise to use combinatorial inputs since they require  
> different handling on the algorithmic side. There is stuff in the pipeline  
> that helps here but I don't think we can just throw shingles against it and  
> it will work. I experimented with it but it can quickly explode which is  
> another thing we need to take care of. I agree we need to make the  
> interface better and for freetext this one will not work at this point but  
> I don't think this is it's purpose.
> 
> simon
> 
> On Friday, November 29, 2013 7:49:42 PM UTC+1, Karussell wrote:
> 
> > Someone an idea about this?
> > 
> > This is probably not such a big problem with languages having spaces as  
> > separator. Because you can easily split by space and feed some of the  
> > combinations. But how should I make sure completion is done properly with  
> > the other languages like chinese? Why not use a shingle token filter?
> > 
> > Regards,  
> > Peter.
> > 
> > On Thursday, November 28, 2013 2:23:14 PM UTC+1, Karussell wrote:
> > 
> > > Hi there,
> > > 
> > > the completion API looks really nice! There is nearly all I need like  
> > > payloads, weighting etc
> > > 
> > > But assume the example with the hotels [1]. How would you solve the  
> > > problem that the user can do the input in every possible combination  
> > > 'Mercure Hotel Munich', 'Mercure Munich', 'Munich Mercure', ... ? Should I  
> > > specify 3_2_1 input values? What if my input is an address which could  
> > > consist of 6 terms (country, county, town/village, district, zipcode,  
> > > street) plus POI information which can easily lead to over 1000  
> > > combinations per entry!? Should I better use prefix query or nEdgeGram?  
> > > Another possibility would be the facet workaround [2] but this is not nice  
> > > as I need to include a payload value.
> > > 
> > > Also highlighting and (geo) filtering is currently not supported, right?
> > > 
> > > Regards,  
> > > Peter.
> > > 
> > > [1]  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)
> > > 
> > > [2]
> > > 
> > > [Redirecting to Google Groups](https://groups.google.com/forum/#!searchin/elasticsearch/suggestion/elasticsearch/76VIOu32J9Q/zfwTjYLDocgJ)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8045c4c4-e9e7-4923-a5d9-ee0fd3bb16f8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8045c4c4-e9e7-4923-a5d9-ee0fd3bb16f8%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:04am UTC](https://discuss.elastic.co/t/the-completion-suggester-needs-n-input-combinations/14629/5 "2017-07-06T02:04:00Z")

</div>


