Query_string not returning results for searches less than 3 characters

I'm trying to search for a term such as at&t by only searching for at&, but
it never works. The field is analyzed and boosted on indexing, and I'm
wondering if the only way to get that to work is to create
a separate not_analyzed field?

{
"fields": [
"name",
"_id"
],
"query": {
"query_string": {
"default_field": "name",
"query": "at&"
}
}
"size": 15
}

--
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.

ok here is my guess.... you analyzer for the field name tokenizes away the
'&' and drops stopwords such that 'at' never makes it to the index so you
get 0 results?

what analyzer are you using for the name field?

simon

On Tuesday, April 16, 2013 9:08:23 PM UTC+2, Darius Riggins wrote:

I'm trying to search for a term such as at&t by only searching for at&,
but it never works. The field is analyzed and boosted on indexing, and I'm
wondering if the only way to get that to work is to create
a separate not_analyzed field?

{
"fields": [
"name",
"_id"
],
"query": {
"query_string": {
"default_field": "name",
"query": "at&"
}
}
"size": 15
}

--
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.

I'm guessing the default one, that field I didn't do anything special
besides adding a sort field to it. Would it work if I add a new field that
is not analyzed?

On Tuesday, April 16, 2013 3:11:59 PM UTC-4, simonw wrote:

ok here is my guess.... you analyzer for the field name tokenizes away the
'&' and drops stopwords such that 'at' never makes it to the index so you
get 0 results?

what analyzer are you using for the name field?

simon

On Tuesday, April 16, 2013 9:08:23 PM UTC+2, Darius Riggins wrote:

I'm trying to search for a term such as at&t by only searching for at&,
but it never works. The field is analyzed and boosted on indexing, and I'm
wondering if the only way to get that to work is to create
a separate not_analyzed field?

{
"fields": [
"name",
"_id"
],
"query": {
"query_string": {
"default_field": "name",
"query": "at&"
}
}
"size": 15
}

--
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.

with the default analyzer you will see the behaviour I explained above. If
you use some other analyzer that doesn't drop stopwords you should be fine.

simon

On Tuesday, April 16, 2013 9:33:17 PM UTC+2, Darius Riggins wrote:

I'm guessing the default one, that field I didn't do anything special
besides adding a sort field to it. Would it work if I add a new field that
is not analyzed?

On Tuesday, April 16, 2013 3:11:59 PM UTC-4, simonw wrote:

ok here is my guess.... you analyzer for the field name tokenizes away
the '&' and drops stopwords such that 'at' never makes it to the index so
you get 0 results?

what analyzer are you using for the name field?

simon

On Tuesday, April 16, 2013 9:08:23 PM UTC+2, Darius Riggins wrote:

I'm trying to search for a term such as at&t by only searching for at&,
but it never works. The field is analyzed and boosted on indexing, and I'm
wondering if the only way to get that to work is to create
a separate not_analyzed field?

{
"fields": [
"name",
"_id"
],
"query": {
"query_string": {
"default_field": "name",
"query": "at&"
}
}
"size": 15
}

--
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.

Oddly I tried a few other ones, such as simple or lowercase, or keyword,
really was just throwing things at that point. Making a new psuedo-field
and setting to not_analyzed worked fine, not the best option in my case as
I have to then use a wildcard query to get the behavior I want, but I can
live with it as I get the results fine now. Thanks for the help.

On Tuesday, April 16, 2013 3:08:23 PM UTC-4, Darius Riggins wrote:

I'm trying to search for a term such as at&t by only searching for at&,
but it never works. The field is analyzed and boosted on indexing, and I'm
wondering if the only way to get that to work is to create
a separate not_analyzed field?

{
"fields": [
"name",
"_id"
],
"query": {
"query_string": {
"default_field": "name",
"query": "at&"
}
}
"size": 15
}

--
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.