Suggest feature not returning options

Hi,

I have a working elastic search installation and I'm trying to get the
suggestions feature working but it never returns any options.

I've stripped down my issue to the bare essentials.
The mapping looks like this...

curl -XPUT localhost:9200/card-search-model-v18 -d '
{
"mappings":{

    "properties": {
        "doc": {
            "dynamic": "true",
            "properties": {
                "title": {
                    "type": "string"
                }
            }
        }
    }
}

}'

My indexed documents have a title property. Several of them have a title
containing the string "references". I can issue a search and get correct
results by executing...

curl -s -XPOST 'localhost:9200/card-search-model-v18/_search' -d '{
"query": {
"bool": {
"should": [
{
"wildcard": {
"title": "refer"
}
}
]
}
}
}'

When I try a suggest query, the options array is always empty. Here's one
with the mis-typed string "refe[f]ences"

curl -XPOST 'localhost:9200/card-search-model-v18/_suggest' -d '{
"mysuggest" : {
"text" : "refefences",
"term" : {
"field" : "title"
}
}
}'

Is there something else I need to setup? Is there something wrong with the
suggest query?

Thanks,
Scott

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

strange, can you post some of your data you indexed and your mapping of
that index, seems to work here after a quick test

curl -X DELETE localhost:9200/test
curl -X PUT localhost:9200/test
curl -X PUT 'localhost:9200/test/foo/1?refresh=true' -d '{ "title": "My
references" }'
curl -X PUT 'localhost:9200/test/foo/2?refresh=true' -d '{ "title": "Your
references" }'
curl -X PUT 'localhost:9200/test/foo/3?refresh=true' -d '{ "title": "Our
references" }'
curl -XPOST 'localhost:9200/test/_suggest' -d '{ "test" : { "text" :
"refefences", "term" : { "field" : "title" } } }'

what's the difference between your and my sample?

--Alex

On Fri, Jul 12, 2013 at 8:00 PM, Scott Walters scottw512@gmail.com wrote:

Hi,

I have a working Elasticsearch installation and I'm trying to get the
suggestions feature working but it never returns any options.

I've stripped down my issue to the bare essentials.
The mapping looks like this...

curl -XPUT localhost:9200/card-search-model-v18 -d '
{
"mappings":{

    "properties": {
        "doc": {
            "dynamic": "true",
            "properties": {
                "title": {
                    "type": "string"
                }
            }
        }
    }
}

}'

My indexed documents have a title property. Several of them have a title
containing the string "references". I can issue a search and get correct
results by executing...

curl -s -XPOST 'localhost:9200/card-search-model-v18/_search' -d '{
"query": {
"bool": {
"should": [
{
"wildcard": {
"title": "refer"
}
}
]
}
}
}'

When I try a suggest query, the options array is always empty. Here's one
with the mis-typed string "refe[f]ences"

curl -XPOST 'localhost:9200/card-search-model-v18/_suggest' -d '{
"mysuggest" : {
"text" : "refefences",
"term" : {
"field" : "title"
}
}
}'

Is there something else I need to setup? Is there something wrong with the
suggest query?

Thanks,
Scott

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks for the reply. I tried your sample and it works for me. Now I'm
trying to figure out why. I think it has something to do with my mapping
(which is below) not agreeing with the input JSON to the suggest API. As an
experiment, I tried using the POST and suggest commands from your example
against my index. When I did this, I got results. The commands I tried were

curl -X PUT 'localhost:9200/card-search-model-v18/foo/3333?refresh=true' -d
'{ "title": "Our references" }'
curl -XPOST 'localhost:9200/card-search-model-v18/_suggest' -d '{ "test" :
{ "text" : "refefences", "term" : { "field" : "title" } } }'

So now I'm pondering the significance of the "foo" part of the URL in your
example, and why it would search documents from there and now where the
couchbase transport plugin is putting them

The mapping I tried was

curl -XPUT localhost:9200/cst1 -d '
{
"mappings":{
"couchbaseDocument": {
"properties": {
"doc": {
"dynamic": "true",
"properties": {
"title": {
"type": "string"
}
}
}
}
}
}
}'

On Monday, July 15, 2013 1:43:59 AM UTC-5, Alexander Reelsen wrote:

Hey,

strange, can you post some of your data you indexed and your mapping of
that index, seems to work here after a quick test

curl -X DELETE localhost:9200/test
curl -X PUT localhost:9200/test
curl -X PUT 'localhost:9200/test/foo/1?refresh=true' -d '{ "title": "My
references" }'
curl -X PUT 'localhost:9200/test/foo/2?refresh=true' -d '{ "title": "Your
references" }'
curl -X PUT 'localhost:9200/test/foo/3?refresh=true' -d '{ "title": "Our
references" }'
curl -XPOST 'localhost:9200/test/_suggest' -d '{ "test" : { "text" :
"refefences", "term" : { "field" : "title" } } }'

what's the difference between your and my sample?

--Alex

On Fri, Jul 12, 2013 at 8:00 PM, Scott Walters <scot...@gmail.com<javascript:>

wrote:

Hi,

I have a working Elasticsearch installation and I'm trying to get the
suggestions feature working but it never returns any options.

I've stripped down my issue to the bare essentials.
The mapping looks like this...

curl -XPUT localhost:9200/card-search-model-v18 -d '
{
"mappings":{

    "properties": {
        "doc": {
            "dynamic": "true",
            "properties": {
                "title": {
                    "type": "string"
                }
            }
        }
    }
}

}'

My indexed documents have a title property. Several of them have a title
containing the string "references". I can issue a search and get correct
results by executing...

curl -s -XPOST 'localhost:9200/card-search-model-v18/_search' -d '{
"query": {
"bool": {
"should": [
{
"wildcard": {
"title": "refer"
}
}
]
}
}
}'

When I try a suggest query, the options array is always empty. Here's one
with the mis-typed string "refe[f]ences"

curl -XPOST 'localhost:9200/card-search-model-v18/_suggest' -d '{
"mysuggest" : {
"text" : "refefences",
"term" : {
"field" : "title"
}
}
}'

Is there something else I need to setup? Is there something wrong with
the suggest query?

Thanks,
Scott

--
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:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

I have found out what the problem is. Going back to the model and queries
in the original post, and looking at the documents I was searching on, I
noticed there was an extra JSON node called doc, so I modified the suggest
query to look like the one below, where I highlighted the modified field
term. Now I get the suggestions I was expecting.

curl -XPOST 'localhost:9200/card-search-model-v18/_suggest' -d '{
"mysuggest" : {
"text" : "refefences",
"term" : {
"field" : "doc.title"
}
}
}'

On Tuesday, July 16, 2013 10:46:49 AM UTC-5, Scott Walters wrote:

Thanks for the reply. I tried your sample and it works for me. Now I'm
trying to figure out why. I think it has something to do with my mapping
(which is below) not agreeing with the input JSON to the suggest API. As an
experiment, I tried using the POST and suggest commands from your example
against my index. When I did this, I got results. The commands I tried were

curl -X PUT 'localhost:9200/card-search-model-v18/foo/3333?refresh=true'
-d '{ "title": "Our references" }'
curl -XPOST 'localhost:9200/card-search-model-v18/_suggest' -d '{ "test" :
{ "text" : "refefences", "term" : { "field" : "title" } } }'

So now I'm pondering the significance of the "foo" part of the URL in your
example, and why it would search documents from there and now where the
couchbase transport plugin is putting them

The mapping I tried was

curl -XPUT localhost:9200/cst1 -d '
{
"mappings":{
"couchbaseDocument": {
"properties": {
"doc": {
"dynamic": "true",
"properties": {
"title": {
"type": "string"
}
}
}
}
}
}
}'

On Monday, July 15, 2013 1:43:59 AM UTC-5, Alexander Reelsen wrote:

Hey,

strange, can you post some of your data you indexed and your mapping of
that index, seems to work here after a quick test

curl -X DELETE localhost:9200/test
curl -X PUT localhost:9200/test
curl -X PUT 'localhost:9200/test/foo/1?refresh=true' -d '{ "title": "My
references" }'
curl -X PUT 'localhost:9200/test/foo/2?refresh=true' -d '{ "title": "Your
references" }'
curl -X PUT 'localhost:9200/test/foo/3?refresh=true' -d '{ "title": "Our
references" }'
curl -XPOST 'localhost:9200/test/_suggest' -d '{ "test" : { "text" :
"refefences", "term" : { "field" : "title" } } }'

what's the difference between your and my sample?

--Alex

On Fri, Jul 12, 2013 at 8:00 PM, Scott Walters scot...@gmail.com wrote:

Hi,

I have a working Elasticsearch installation and I'm trying to get the
suggestions feature working but it never returns any options.

I've stripped down my issue to the bare essentials.
The mapping looks like this...

curl -XPUT localhost:9200/card-search-model-v18 -d '
{
"mappings":{

    "properties": {
        "doc": {
            "dynamic": "true",
            "properties": {
                "title": {
                    "type": "string"
                }
            }
        }
    }
}

}'

My indexed documents have a title property. Several of them have a title
containing the string "references". I can issue a search and get correct
results by executing...

curl -s -XPOST 'localhost:9200/card-search-model-v18/_search' -d '{
"query": {
"bool": {
"should": [
{
"wildcard": {
"title": "refer"
}
}
]
}
}
}'

When I try a suggest query, the options array is always empty. Here's
one with the mis-typed string "refe[f]ences"

curl -XPOST 'localhost:9200/card-search-model-v18/_suggest' -d '{
"mysuggest" : {
"text" : "refefences",
"term" : {
"field" : "title"
}
}
}'

Is there something else I need to setup? Is there something wrong with
the suggest query?

Thanks,
Scott

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.