How to do exact term matching?


(lysd) #1

Hi

This is my first in this group. Have only started to work on elasticsearch
so am new to ES.

I'm trying to find out how do I get exact matches. For example,

"Foxconn preparing to build Apple HDTV?"
"Foxconn boss confirms Apple TV set"‎

When I query for "Apple" I get both documents returned. If I query for
"Apple HDTV" I still get both documents.

I've looked at the group, suggestions include "not_analyzed" and "keyword"
analyzer, both I've tried and failed. Have also tried to do bool query, and
failed too.

Can any give me some clue?

Thanks in advance

D.


(lysd) #2

Nevermind, I found what I was looking for.
http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html

Thanks

On Monday, May 14, 2012 5:23:34 PM UTC+8, lysd wrote:

Hi

This is my first in this group. Have only started to work on elasticsearch
so am new to ES.

I'm trying to find out how do I get exact matches. For example,

"Foxconn preparing to build Apple HDTV?"
"Foxconn boss confirms Apple TV set"‎

When I query for "Apple" I get both documents returned. If I query for
"Apple HDTV" I still get both documents.

I've looked at the group, suggestions include "not_analyzed" and "keyword"
analyzer, both I've tried and failed. Have also tried to do bool query, and
failed too.

Can any give me some clue?

Thanks in advance

D.


(Shay Banon) #3

Or, check the text query as well, more specifically phrase searches.

On Mon, May 14, 2012 at 1:15 PM, lysd lysding@gmail.com wrote:

Nevermind, I found what I was looking for.

http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html

Thanks

On Monday, May 14, 2012 5:23:34 PM UTC+8, lysd wrote:

Hi

This is my first in this group. Have only started to work on
elasticsearch so am new to ES.

I'm trying to find out how do I get exact matches. For example,

"Foxconn preparing to build Apple HDTV?"
"Foxconn boss confirms Apple TV set"‎

When I query for "Apple" I get both documents returned. If I query for
"Apple HDTV" I still get both documents.

I've looked at the group, suggestions include "not_analyzed" and
"keyword" analyzer, both I've tried and failed. Have also tried to do bool
query, and failed too.

Can any give me some clue?

Thanks in advance

D.


(system) #4