Returning exact matches with ElasticSearch 'Lite'

I'm trying to use ES's search lite
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/search-lite.html to
query a dataset which contains a key foo. An example of this is:

.../_search?q=+foo:bar-baz

Now, my understanding is is that the addition of + to the foo attribute
should make this search return only exactly matches where foo is bar-baz.
However, I'm finding that I'm also getting other results coming back, for
instance foo-baz or baz-baz etc.

What am I doing wrong here which is causing these other results to be
returned? How can I resolve this?

--
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/f77af3af-8615-44c2-9d86-f9b6c1692f63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Use URI escaping (percent encoding). It is perfectly described on the page
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/search-lite.html

Jörg

On Mon, Sep 15, 2014 at 2:03 PM, Neil Middleton neil@heroku.com wrote:

I'm trying to use ES's search lite
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/search-lite.html to
query a dataset which contains a key foo. An example of this is:

.../_search?q=+foo:bar-baz

Now, my understanding is is that the addition of + to the foo attribute
should make this search return only exactly matches where foo is bar-baz.
However, I'm finding that I'm also getting other results coming back, for
instance foo-baz or baz-baz etc.

What am I doing wrong here which is causing these other results to be
returned? How can I resolve this?

--
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/f77af3af-8615-44c2-9d86-f9b6c1692f63%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/f77af3af-8615-44c2-9d86-f9b6c1692f63%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/CAKdsXoF7%2BF-sQpm2ypm3YWfVgu7H%2BbO6vEAPbw9e4m824Hd8Aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Percent encoding the string appears to make no difference. Passing in "+foo:bar-baz” or "%2Bfoo%3Abar-baz” yields exactly the same resultset.

Is this potentially to do with the analysis of the strings in question? For instance - I assume by not analysing the foo field the propensity to return ‘similar’ results will be removed as ES won’t have done the analysis on the parts of the word?

For instance: /_analyze?text=foo-bar yields something different to say /_analyze?text=foo-bar&analyzer=whitespace.


N

On Mon, Sep 15, 2014 at 3:12 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

Use URI escaping (percent encoding). It is perfectly described on the page
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/search-lite.html
Jörg
On Mon, Sep 15, 2014 at 2:03 PM, Neil Middleton neil@heroku.com wrote:

I'm trying to use ES's search lite
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/search-lite.html to
query a dataset which contains a key foo. An example of this is:

.../_search?q=+foo:bar-baz

Now, my understanding is is that the addition of + to the foo attribute
should make this search return only exactly matches where foo is bar-baz.
However, I'm finding that I'm also getting other results coming back, for
instance foo-baz or baz-baz etc.

What am I doing wrong here which is causing these other results to be
returned? How can I resolve this?

--
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/f77af3af-8615-44c2-9d86-f9b6c1692f63%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/f77af3af-8615-44c2-9d86-f9b6c1692f63%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 a topic in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/X4wS16I10Ko/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoF7%2BF-sQpm2ypm3YWfVgu7H%2BbO6vEAPbw9e4m824Hd8Aw%40mail.gmail.com.
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/1410793495416.33166361%40Nodemailer.
For more options, visit https://groups.google.com/d/optout.

Yes, you can select a tokenizer for controlling how to split words.

If you index "bar-baz", you index two words, bar and baz, because standard
analyzer delimits tokens according to Unicode text segmentation rules in
http://unicode.org/reports/tr29/

So the easiest method to use standard tokenizer is probably by phrase
search, and it works like this:

PUT /test/doc/1
{
"foo" : "bar"
}

PUT /test/doc/2
{
"foo" : "bar-baz"
}

GET /test/_refresh

GET /test/_search?q=%22bar%2Dbaz%22

Jörg

On Mon, Sep 15, 2014 at 5:04 PM, Neil Middleton neil@heroku.com wrote:

Percent encoding the string appears to make no difference. Passing in
"+foo:bar-baz” or "%2Bfoo%3Abar-baz” yields exactly the same resultset.

Is this potentially to do with the analysis of the strings in question?
For instance - I assume by not analysing the foo field the propensity to
return ‘similar’ results will be removed as ES won’t have done the analysis
on the parts of the word?

For instance: /_analyze?text=foo-bar yields something different to say
/_analyze?text=foo-bar&analyzer=whitespace.


N

On Mon, Sep 15, 2014 at 3:12 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

Use URI escaping (percent encoding). It is perfectly described on the
page
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/search-lite.html

Jörg

On Mon, Sep 15, 2014 at 2:03 PM, Neil Middleton neil@heroku.com wrote:

I'm trying to use ES's search lite
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/search-lite.html to
query a dataset which contains a key foo. An example of this is:

.../_search?q=+foo:bar-baz

Now, my understanding is is that the addition of + to the foo attribute
should make this search return only exactly matches where foo is bar-baz.
However, I'm finding that I'm also getting other results coming back, for
instance foo-baz or baz-baz etc.

What am I doing wrong here which is causing these other results to be
returned? How can I resolve this?

--
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/f77af3af-8615-44c2-9d86-f9b6c1692f63%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/f77af3af-8615-44c2-9d86-f9b6c1692f63%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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/X4wS16I10Ko/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoF7%2BF-sQpm2ypm3YWfVgu7H%2BbO6vEAPbw9e4m824Hd8Aw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoF7%2BF-sQpm2ypm3YWfVgu7H%2BbO6vEAPbw9e4m824Hd8Aw%40mail.gmail.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/1410793495416.33166361%40Nodemailer
https://groups.google.com/d/msgid/elasticsearch/1410793495416.33166361%40Nodemailer?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/CAKdsXoGnLQ1d5AZQym9n1wWsY_aC0hfWtZRfouRqHK2jsA%3DdSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.