I have an index of photos and need to return completion suggestions based
on several of the fields:
Tags
Place
Country
Date
The simplest way to do this of course would be to create one completion
suggester and simply feed the various inputs into it when indexing.
However, I need to receive up to 5 suggestions per field and I need to
return various different outputs depending on the input (they cannot simply
have a unified output)
For example:
When the user types "T" the suggestions should be something like the
following :
Tags : [Tree, Tiger, Toner]
Place : [Tenerife, The London Eye, Torquay]
Country : [Taiwan, Tanzania]
Date : []
The date field simply stores tags for the month and year [January, 2014]
enabling suggestions to come back as January when a user types "jan" and
gives year suggestions when the user type "20" etc...
In order to achieve this I have set up a different completion suggester
with varying analyzers for each of the above fields, I then query all four
suggesters at once in a single request. Everything works perfectly.
However I am left wondering if there is a better way to achieve this
functionality.
Is there any way to achieve the above with a single completion
suggester
Are there any concerns/watch outs when querying multiple suggesters in
this manner? Performance or otherwise.
I have an index of photos and need to return completion suggestions based
on several of the fields:
Tags
Place
Country
Date
The simplest way to do this of course would be to create one completion
suggester and simply feed the various inputs into it when indexing.
However, I need to receive up to 5 suggestions per field and I need to
return various different outputs depending on the input (they cannot simply
have a unified output)
For example:
When the user types "T" the suggestions should be something like the
following :
Tags : [Tree, Tiger, Toner]
Place : [Tenerife, The London Eye, Torquay]
Country : [Taiwan, Tanzania]
Date :
The date field simply stores tags for the month and year [January, 2014]
enabling suggestions to come back as January when a user types "jan" and
gives year suggestions when the user type "20" etc...
In order to achieve this I have set up a different completion suggester
with varying analyzers for each of the above fields, I then query all four
suggesters at once in a single request. Everything works perfectly.
However I am left wondering if there is a better way to achieve this
functionality.
Is there any way to achieve the above with a single completion
suggester
Are there any concerns/watch outs when querying multiple suggesters
in this manner? Performance or otherwise.
Thanks for your speedy response. I'm very new to Elasticsearch so it's
good to know I am doing the write thing.
I guess i'll continue as I am unless anyone else can think of any reason
not to.
Cheers!
On Wednesday, July 23, 2014 2:34:08 PM UTC+1, Adrien Grand wrote:
Hi Gordon,
Given your requirements, I think you are doing the right thing. There is
no particular concern wrt querying multiple suggesters at the same time.
On Wed, Jul 23, 2014 at 3:20 PM, Gordon Rankin <gor...@ripplesoup.com
<javascript:>> wrote:
I have an index of photos and need to return completion suggestions based
on several of the fields:
Tags
Place
Country
Date
The simplest way to do this of course would be to create one completion
suggester and simply feed the various inputs into it when indexing.
However, I need to receive up to 5 suggestions per field and I need to
return various different outputs depending on the input (they cannot simply
have a unified output)
For example:
When the user types "T" the suggestions should be something like the
following :
Tags : [Tree, Tiger, Toner]
Place : [Tenerife, The London Eye, Torquay]
Country : [Taiwan, Tanzania]
Date :
The date field simply stores tags for the month and year [January, 2014]
enabling suggestions to come back as January when a user types "jan" and
gives year suggestions when the user type "20" etc...
In order to achieve this I have set up a different completion suggester
with varying analyzers for each of the above fields, I then query all four
suggesters at once in a single request. Everything works perfectly.
However I am left wondering if there is a better way to achieve this
functionality.
Is there any way to achieve the above with a single completion
suggester
Are there any concerns/watch outs when querying multiple suggesters
in this manner? Performance or otherwise.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.