Unable to Search and Terms Facet for a field value 'A' of the indexed document

Hi!

I have a document indexed which has field BayesianAnalysers and the field
data is stored as following:

"BayesianAnalysers":[{"Safety":[{"text":"Undecided"}],"Power":[{"text":"Undecided"}],"Freedom":[{"text":"A"}],"Growth":[{"text":"B"}],"Subscribe":[{"text":"Undecided"}],"Desire":[{"text":"Undecided"}],"Intent":[{"text":"B"}],"Sentiment":[{"text":"Undecided"}]

When I run search query or Terms Facet for field values having value "A",
example in the case above, BayesianAnalysers.Freedom.text="A"; it fails to
search however for the field values "B" or "Undecided", it works fine. I
used Java API as well and this results same :frowning:

Please suggest and let me know if need any additional input.

regards,
surya

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

If you are using the default Standard analyzer, then "a" is treated as a
stop word and ignored. Another analyzer (perhaps custom) is better suited
for your field.

--
Ivan

On Mon, Jul 1, 2013 at 8:34 AM, Kumar Surya Mani ksuryamani@gmail.comwrote:

Hi!

I have a document indexed which has field BayesianAnalysers and the field
data is stored as following:

"BayesianAnalysers":[{"Safety":[{"text":"Undecided"}],"Power":[{"text":"Undecided"}],"Freedom":[{"text":"A"}],"Growth":[{"text":"B"}],"Subscribe":[{"text":"Undecided"}],"Desire":[{"text":"Undecided"}],"Intent":[{"text":"B"}],"Sentiment":[{"text":"Undecided"}]

When I run search query or Terms Facet for field values having value "A",
example in the case above, BayesianAnalysers.Freedom.text="A"; it fails to
search however for the field values "B" or "Undecided", it works fine. I
used Java API as well and this results same :frowning:

Please suggest and let me know if need any additional input.

regards,
surya

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

You changed the analyzer used to analyze the terms in your query, but your
index was still created with the Standard analyzer, therefore the terms do
not exist in your index.

You need to change the analyzer used at index time. The trick to using
Lucene (and therefore elasticsearch) is to ensure that you use the same
analyzer during indexing and searching (not always the case, but in
general).

BTW, you should always reply to the mailing list and not to anyone one
person that replies. There are a ton of smart people on the mailing list
and many of them are eager to help.

Cheers,

Ivan

On Mon, Jul 1, 2013 at 10:56 AM, Kumar Surya Mani ksuryamani@gmail.comwrote:

Ivan, thanks for your response.

Here I am trying to use 2 different analyzers, keyword and whitespace,
there is no change in the text analysis.

curl -X POST "
http://localhost:9200/surya1/_search?pretty=true&analyzer=keyword"
-d'{"query":{"multi_match":{"query":"A B Undecided", "fields":
["BayesianAnalysers.Intet.text","BayesianAnalysers.Subscribe.text"]}},"facets":{"format":{"terms":{"field":"BayesianAnalysers.Subscribe.text"}}}}'

"facets" : {
"format" : {
"_type" : "terms",
"missing" : 69,
"total" : 125,
"other" : 0,
"terms" : [ {
"term" : "undecided",
"count" : 98
}, {
"term" : "b",
"count" : 27
} ]
}
}

curl -X POST "
http://localhost:9200/surya1/_search?pretty=true&analyzer=whitespace"
-d'{"query":{"multi_match":{"query":"A B Undecided", "fields":
["BayesianAnalysers.Itent.text","BayesianAnalysers.Subscribe.text"]}},"facets":{"format":{"terms":{"field":"BayesianAnalysers.Subscribe.text"}}}}

"facets" : {
"format" : {
"_type" : "terms",
"missing" : 69,
"total" : 125,
"other" : 0,
"terms" : [ {
"term" : "undecided",
"count" : 98
}, {
"term" : "b",
"count" : 27
} ]
}
}

Here again only "B" and "Undecided" values are considered.

--@surya

On Monday, July 1, 2013 9:42:03 PM UTC+5:30, Ivan Brusic wrote:

If you are using the default Standard analyzer, then "a" is treated as a
stop word and ignored. Another analyzer (perhaps custom) is better suited
for your field.

--
Ivan

On Mon, Jul 1, 2013 at 8:34 AM, Kumar Surya Mani ksury...@gmail.comwrote:

Hi!

I have a document indexed which has field BayesianAnalysers and the
field data is stored as following:

"BayesianAnalysers":[{"Safety":[{"text":"Undecided"}],"
Power":[{"text":"Undecided"}],"Freedom":[{"text":"A"}],"
Growth":[{"text":"B"}],"Subscribe":[{"text":"
Undecided"}],"Desire":[{"text":"Undecided"}],"Intent":[{"
text":"B"}],"Sentiment":[{"**text":"Undecided"}]

When I run search query or Terms Facet for field values having value
"A", example in the case above, BayesianAnalysers.Freedom.**text="A";
it fails to search however for the field values "B" or "Undecided", it
works fine. I used Java API as well and this results same :frowning:

Please suggest and let me know if need any additional input.

regards,
surya

--
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_outhttps://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.

On Monday, July 1, 2013 9:04:06 PM UTC+5:30, Kumar Surya Mani wrote:

Hi!

I have a document indexed which has field BayesianAnalysers and the field
data is stored as following:

"BayesianAnalysers":[{"Safety":[{"text":"Undecided"}],"Power":[{"text":"Undecided"}],"Freedom":[{"text":"A"}],"Growth":[{"text":"B"}],"Subscribe":[{"text":"Undecided"}],"Desire":[{"text":"Undecided"}],"Intent":[{"text":"B"}],"Sentiment":[{"text":"Undecided"}]

When I run search query or Terms Facet for field values having value "A",
example in the case above, BayesianAnalysers.Freedom.text="A"; it fails to
search however for the field values "B" or "Undecided", it works fine. I
used Java API as well and this results same :frowning:

Please suggest and let me know if need any additional input.

regards,
surya

--
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 Ivan...I need to explore it further.

On Monday, July 1, 2013 11:53:48 PM UTC+5:30, Ivan Brusic wrote:

You changed the analyzer used to analyze the terms in your query, but your
index was still created with the Standard analyzer, therefore the terms do
not exist in your index.

You need to change the analyzer used at index time. The trick to using
Lucene (and therefore elasticsearch) is to ensure that you use the same
analyzer during indexing and searching (not always the case, but in
general).

BTW, you should always reply to the mailing list and not to anyone one
person that replies. There are a ton of smart people on the mailing list
and many of them are eager to help.

Cheers,

Ivan

On Mon, Jul 1, 2013 at 10:56 AM, Kumar Surya Mani <ksury...@gmail.com<javascript:>

wrote:

Ivan, thanks for your response.

Here I am trying to use 2 different analyzers, keyword and whitespace,
there is no change in the text analysis.

curl -X POST "
http://localhost:9200/surya1/_search?pretty=true&analyzer=keyword"
-d'{"query":{"multi_match":{"query":"A B Undecided", "fields":
["BayesianAnalysers.Intet.text","BayesianAnalysers.Subscribe.text"]}},"facets":{"format":{"terms":{"field":"BayesianAnalysers.Subscribe.text"}}}}'

"facets" : {
"format" : {
"_type" : "terms",
"missing" : 69,
"total" : 125,
"other" : 0,
"terms" : [ {
"term" : "undecided",
"count" : 98
}, {
"term" : "b",
"count" : 27
} ]
}
}

curl -X POST "
http://localhost:9200/surya1/_search?pretty=true&analyzer=whitespace"
-d'{"query":{"multi_match":{"query":"A B Undecided", "fields":
["BayesianAnalysers.Itent.text","BayesianAnalysers.Subscribe.text"]}},"facets":{"format":{"terms":{"field":"BayesianAnalysers.Subscribe.text"}}}}

"facets" : {
"format" : {
"_type" : "terms",
"missing" : 69,
"total" : 125,
"other" : 0,
"terms" : [ {
"term" : "undecided",
"count" : 98
}, {
"term" : "b",
"count" : 27
} ]
}
}

Here again only "B" and "Undecided" values are considered.

--@surya

On Monday, July 1, 2013 9:42:03 PM UTC+5:30, Ivan Brusic wrote:

If you are using the default Standard analyzer, then "a" is treated as a
stop word and ignored. Another analyzer (perhaps custom) is better suited
for your field.

--
Ivan

On Mon, Jul 1, 2013 at 8:34 AM, Kumar Surya Mani ksury...@gmail.comwrote:

Hi!

I have a document indexed which has field BayesianAnalysers and the
field data is stored as following:

"BayesianAnalysers":[{"Safety":[{"text":"Undecided"}],"
Power":[{"text":"Undecided"}],"Freedom":[{"text":"A"}],"
Growth":[{"text":"B"}],"Subscribe":[{"text":"
Undecided"}],"Desire":[{"text":"Undecided"}],"Intent":[{"
text":"B"}],"Sentiment":[{"**text":"Undecided"}]

When I run search query or Terms Facet for field values having value
"A", example in the case above, BayesianAnalysers.Freedom.**text="A";
it fails to search however for the field values "B" or "Undecided", it
works fine. I used Java API as well and this results same :frowning:

Please suggest and let me know if need any additional input.

regards,
surya

--
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_outhttps://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.