Is there a better way to achieve my goal than having multiple completion suggesters on a single index?


(Gordon Rankin) #1

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 in advance for any advice or suggestions.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/bd670fb7-303f-4719-821c-82b65fec86e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Adrien Grand) #2

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 gordon@ripplesoup.com
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.

Thanks in advance for any advice or suggestions.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/bd670fb7-303f-4719-821c-82b65fec86e9%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/bd670fb7-303f-4719-821c-82b65fec86e9%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Adrien Grand

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4%2BPdWf1xrX9DoWA7FgWfKjE_ytTG-UpBTG%3DkEYWJ90ng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Gordon Rankin) #3

Thanks Adrien...

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.

Thanks in advance for any advice or suggestions.

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/bd670fb7-303f-4719-821c-82b65fec86e9%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/bd670fb7-303f-4719-821c-82b65fec86e9%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Adrien Grand

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b10e1f2a-7b3c-4102-a855-aae78da02bea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4