Quoted text search


(Ahmed Sabaa) #1

I am trying to search for a text (for example mcdonald) in my index and my
biggest issue is that if the word Terry is present in the selected field
but followed by an apostrophe (or a single quote, like McDonald's) the
search yields no result. I have a feeling that it's a problem with the
standard tokenizer so I wanted to use the letter tokenizer (as far as I
understood it would work?). So I create the index with the following :

"analysis": {
"analyzer": {
"standard": {
"tokenizer": "letter"
}
}
}

And it didn't change anything. Also I cannot find the actual analyzer used
by the index at creation. I also tried:
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "snowball",
"language": "English"
}
}
}

At index creation. As I said the biggest issue is that I cannot find the
actual analyzer used by the index nor find out what's wrong with my search
query.

P.S I am using :
"bool": {
"must": ['query_string': {
"fields": ["name.en"],
"query": 'mcdonald'
}]
}

For the actual searching. The documentation is kind of vague in this
prospect and I cannot find any solution to it anywhere.

Regards,

--
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/5475a029-537c-4229-ad58-b99abfc19fdf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alexander Reelsen) #2

Hey,

please checkout the analyze API, which shows how a field gets broken down
into terms using a certain analyzer. This should help you to pick the right
one. Also, you might want to install the inquisitor plugin for a nice GUI
on top of the Analyze API

If you do not configure anything the analyzer is the standard analyzer.
However you can see the analyzer used per field in the mapping API.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-analyze.html


http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html

--Alex

On Fri, Jan 17, 2014 at 10:22 PM, Ahmed Sabaa ahmedsabaa89@gmail.comwrote:

I am trying to search for a text (for example mcdonald) in my index and my
biggest issue is that if the word Terry is present in the selected field
but followed by an apostrophe (or a single quote, like McDonald's) the
search yields no result. I have a feeling that it's a problem with the
standard tokenizer so I wanted to use the letter tokenizer (as far as I
understood it would work?). So I create the index with the following :

"analysis": {
"analyzer": {
"standard": {
"tokenizer": "letter"
}
}
}

And it didn't change anything. Also I cannot find the actual analyzer used
by the index at creation. I also tried:
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "snowball",
"language": "English"
}
}
}

At index creation. As I said the biggest issue is that I cannot find the
actual analyzer used by the index nor find out what's wrong with my search
query.

P.S I am using :
"bool": {
"must": ['query_string': {
"fields": ["name.en"],
"query": 'mcdonald'
}]
}

For the actual searching. The documentation is kind of vague in this
prospect and I cannot find any solution to it anywhere.

Regards,

--
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/5475a029-537c-4229-ad58-b99abfc19fdf%40googlegroups.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-CaFoaDQpz4Jp8CqAfRxRn-GN0FNLAOoac8zZCxKEewQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3