Hi, Is there a way to tell the context suggester to display results for all
the categories ?
I know that for the category suggester query I must provide context/s
Sort of:
{
"suggest" : {
"text" : "m",
"completion" : {
"field" : "suggest_field",
"size": 10,
"context": {
"color": "*"
}
}
}
}
This should work like simple completion suggester no matter what "color"
each document has.
So I should be able to find suggestions, and filter them (by "color") only
when needed.
--
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/e6a44204-207e-42bc-8bf0-bc60e0869496%40googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
spinscale
(Alexander Reelsen)
August 4, 2014, 9:21am
2
Hey,
you could simply index an 'all' color field value for every document, and
then use that for your suggestions?
--Alex
On Mon, Aug 4, 2014 at 10:50 AM, Tihomir Lichev shoteff@gmail.com wrote:
Hi, Is there a way to tell the context suggester to display results for
all the categories ?
I know that for the category suggester query I must provide context/s
Sort of:
{
"suggest" : {
"text" : "m",
"completion" : {
"field" : "suggest_field",
"size": 10,
"context": {
"color": "*"
}
}
}
}
This should work like simple completion suggester no matter what "color"
each document has.
So I should be able to find suggestions, and filter them (by "color") only
when needed.
--
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/e6a44204-207e-42bc-8bf0-bc60e0869496%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/e6a44204-207e-42bc-8bf0-bc60e0869496%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout .
--
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/CAGCwEM8_q_k_CBgmq7C0ir2A1KfZMA%2BiNYGYrieV_aL4_JgW-w%40mail.gmail.com .
For more options, visit https://groups.google.com/d/optout .
Thank you Alex,
I also came up with that idea, but I think it is not that useful when you
have context, mapped to a field, which usually contains a single value,
especially numeric fields (despite that
https://github.com/elasticsearch/elasticsearch/issues/6512 is not fixed yet)
--
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/6ca0e8df-b21a-4f3a-afa5-0b57c91c03c1%40googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
spinscale
(Alexander Reelsen)
August 5, 2014, 8:41am
4
Hey,
maybe the new transform feature could help here to create a default value
(just an idea, havent tested it). See
Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.
--Alex
On Tue, Aug 5, 2014 at 10:13 AM, Tihomir Lichev shoteff@gmail.com wrote:
Thank you Alex,
I also came up with that idea, but I think it is not that useful when you
have context, mapped to a field, which usually contains a single value,
especially numeric fields (despite that
Context Suggester: Context does not work with non strings in mapping · Issue #6512 · elastic/elasticsearch · GitHub is not fixed
yet)
--
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/6ca0e8df-b21a-4f3a-afa5-0b57c91c03c1%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/6ca0e8df-b21a-4f3a-afa5-0b57c91c03c1%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout .
--
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/CAGCwEM9b7Nw-PhVV8WoVq2prx0-egCR94er2SMm%2B3xRM0PLVYw%40mail.gmail.com .
For more options, visit https://groups.google.com/d/optout .
Thanks Alex,
I made it
I'm using transformation script to add "*" to any of the context fields.
But I definitely think that issues:
opened 10:00PM - 09 Jun 14 UTC
closed 08:36PM - 11 Dec 14 UTC
running the example given in the documentation is throwing an error:
{
"_sha… rds": {
"total": 5,
"successful": 4,
"failed": 1,
"failures": [
{
"index": "services",
"shard": 2,
"reason": "BroadcastShardOperationFailedException[[services][2] ]; nested: ElasticsearchException[failed to execute suggest]; nested: NullPointerException; "
}
]
}
}
here's the code example given:
PUT /services
PUT /services/service/_mapping
{
"service": {
"properties": {
"name": {
"type" : "string"
},
"tag": {
"type" : "string"
},
"suggest_field": {
"type": "completion",
"context": {
"color": {
"type": "category",
"path": "color_field",
"default": ["red", "green", "blue"]
},
"location": {
"type": "geo",
"precision": "5m",
"neighbors": true,
"default": "u33"
}
}
}
}
}
}
PUT services/service/1
{
"name": "knapsack",
"suggest_field": {
"input": ["knacksack", "backpack", "daypack"],
"context": {
"color": ["red", "yellow"]
}
}
}
POST services/_suggest?pretty'
{
"suggest" : {
"text" : "m",
"completion" : {
"field" : "suggest_field",
"size": 10,
"context": {
"color": "red"
}
}
}
}
opened 01:02PM - 16 Jun 14 UTC
closed 02:57PM - 21 Nov 15 UTC
Hey,
the context suggester only works with strings in the mapping if you specif… y a field, see this example
```
DELETE /services
PUT /services
PUT /services/service/_mapping
{
"service": {
"properties": {
"network_id": {
"type" : "long"
},
"suggest_field": {
"type": "completion",
"context": {
"network": {
"type": "category",
"path": "network_id"
}
}
},
"suggest_field2": {
"type": "completion",
"context": {
"network": {
"type": "category"
}
}
}
}
}
}
PUT /services/service/1
{
"name": "knapsack",
"network_id": "1",
"suggest_field": {
"input": ["knacksack", "backpack", "daypack"]
},
"suggest_field2": {
"input": ["knacksack", "backpack", "daypack"],
"context" : {
"network" : "1"
}
}
}
POST services/_suggest?pretty'
{
"suggest" : {
"text" : "k",
"completion" : {
"field" : "suggest_field",
"size": 10,
"context": {
"network": "1"
}
}
},
"suggest2" : {
"text" : "k",
"completion" : {
"field" : "suggest_field2",
"size": 10,
"context": {
"network": "1"
}
}
}
}
```
Solution 1: Call `toString()` for everything
Solution 2: Reject contexts for anything else than strings
have to be fixed
Probably also provide some way to select any value also for non-string
fields (if issue 6512 end up as toString conversion)
05 август 2014, вторник, 11:41:33 UTC+3, Alexander Reelsen написа:
Hey,
maybe the new transform feature could help here to create a default value
(just an idea, havent tested it). See
Elasticsearch Platform — Find real-time answers at scale | Elastic
--Alex
On Tue, Aug 5, 2014 at 10:13 AM, Tihomir Lichev <sho...@gmail.com
<javascript:>> wrote:
Thank you Alex,
I also came up with that idea, but I think it is not that useful when you
have context, mapped to a field, which usually contains a single value,
especially numeric fields (despite that
Context Suggester: Context does not work with non strings in mapping · Issue #6512 · elastic/elasticsearch · GitHub is not fixed
yet)
--
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/6ca0e8df-b21a-4f3a-afa5-0b57c91c03c1%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/6ca0e8df-b21a-4f3a-afa5-0b57c91c03c1%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout .
--
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/5ae47c01-0bc6-465b-a58d-70a4fc2de0fa%40googlegroups.com .
For more options, visit https://groups.google.com/d/optout .