Inconsistent results when searching within one type vs all types


(Amit Soni) #1

Hi all - I just observed something weird and was wondering if anyone else
has seen this type of behavior and what might be the possible reason for
the same.

We are using 3 types within a single index. When I execute my
filtered-query against a specific type, I get a few matches. However when I
run the same query but specify all the types, I do not get any documents.

For instance:

Query against http://[host]:9201/index_alias1/type1 ---> Gives me a few
matches

Query against http://[host]:9201/index_alias1/type1, type2, type3 --->
Gives me zero matches

Note that these three types have different mappings altogether.

Very curious to know what might be causing this inconsistent behavior.

-Amit.

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


(Ivan Brusic) #2

Do the different mappings contain fields with similar names, but different
types (string, int, long, etc.)? If so, are there any errors in the log?
Since the types all share a same Lucene index, the fields with similar
names must be of the same field type even if they are in different
elasticsearch types.

Cheers,

Ivan

On Sun, Nov 24, 2013 at 2:41 AM, Amit Soni amitsoni29@gmail.com wrote:

Hi all - I just observed something weird and was wondering if anyone else
has seen this type of behavior and what might be the possible reason for
the same.

We are using 3 types within a single index. When I execute my
filtered-query against a specific type, I get a few matches. However when I
run the same query but specify all the types, I do not get any documents.

For instance:

Query against http://[host]:9201/index_alias1/type1 ---> Gives me a few
matches

Query against http://[host]:9201/index_alias1/type1, type2, type3 --->
Gives me zero matches

Note that these three types have different mappings altogether.

Very curious to know what might be causing this inconsistent behavior.

-Amit.

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


(Amit Soni) #3

Hi Ivan - Thanks for your response. There are no errors in the logs.
However I do have three fields of the same name and same type (string)
across two different elasticsearch types.
So as a best design practice, is it recommended that the field names should
be different within an index even if they are spread across different
elasticsearch types?

-Amit.

On Sun, Nov 24, 2013 at 10:53 PM, Ivan Brusic ivan@brusic.com wrote:

Do the different mappings contain fields with similar names, but different
types (string, int, long, etc.)? If so, are there any errors in the log?
Since the types all share a same Lucene index, the fields with similar
names must be of the same field type even if they are in different
elasticsearch types.

Cheers,

Ivan

On Sun, Nov 24, 2013 at 2:41 AM, Amit Soni amitsoni29@gmail.com wrote:

Hi all - I just observed something weird and was wondering if anyone else
has seen this type of behavior and what might be the possible reason for
the same.

We are using 3 types within a single index. When I execute my
filtered-query against a specific type, I get a few matches. However when I
run the same query but specify all the types, I do not get any documents.

For instance:

Query against http://[host]:9201/index_alias1/type1 ---> Gives me a
few matches

Query against http://[host]:9201/index_alias1/type1, type2, type3 --->
Gives me zero matches

Note that these three types have different mappings altogether.

Very curious to know what might be causing this inconsistent behavior.

-Amit.

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


(Alexander Reelsen) #4

Hey,

would be great if you could create a reproducible example using curl and
gist, so we can check what is wrong with the query, the data, the
configuration or elasticsearch :slight_smile:

Thanks!

--Alex

On Mon, Nov 25, 2013 at 6:46 PM, Amit Soni amitsoni29@gmail.com wrote:

Hi Ivan - Thanks for your response. There are no errors in the logs.
However I do have three fields of the same name and same type (string)
across two different elasticsearch types.
So as a best design practice, is it recommended that the field names
should be different within an index even if they are spread across
different elasticsearch types?

-Amit.

On Sun, Nov 24, 2013 at 10:53 PM, Ivan Brusic ivan@brusic.com wrote:

Do the different mappings contain fields with similar names, but
different types (string, int, long, etc.)? If so, are there any errors in
the log? Since the types all share a same Lucene index, the fields with
similar names must be of the same field type even if they are in different
elasticsearch types.

Cheers,

Ivan

On Sun, Nov 24, 2013 at 2:41 AM, Amit Soni amitsoni29@gmail.com wrote:

Hi all - I just observed something weird and was wondering if anyone
else has seen this type of behavior and what might be the possible reason
for the same.

We are using 3 types within a single index. When I execute my
filtered-query against a specific type, I get a few matches. However when I
run the same query but specify all the types, I do not get any documents.

For instance:

Query against http://[host]:9201/index_alias1/type1 ---> Gives me a
few matches

Query against http://[host]:9201/index_alias1/type1, type2, type3
---> Gives me zero matches

Note that these three types have different mappings altogether.

Very curious to know what might be causing this inconsistent behavior.

-Amit.

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


(Amit Soni) #5

Hi Alex - Let me give it a try. Since the index is big, I will need to take
out the portion of data which might be causing a problem in order to
prepare a standalone example. Let me try for that and come back.

-Amit.

On Tue, Nov 26, 2013 at 4:33 AM, Alexander Reelsen alr@spinscale.de wrote:

Hey,

would be great if you could create a reproducible example using curl and
gist, so we can check what is wrong with the query, the data, the
configuration or elasticsearch :slight_smile:

Thanks!

--Alex

On Mon, Nov 25, 2013 at 6:46 PM, Amit Soni amitsoni29@gmail.com wrote:

Hi Ivan - Thanks for your response. There are no errors in the logs.
However I do have three fields of the same name and same type (string)
across two different elasticsearch types.
So as a best design practice, is it recommended that the field names
should be different within an index even if they are spread across
different elasticsearch types?

-Amit.

On Sun, Nov 24, 2013 at 10:53 PM, Ivan Brusic ivan@brusic.com wrote:

Do the different mappings contain fields with similar names, but
different types (string, int, long, etc.)? If so, are there any errors in
the log? Since the types all share a same Lucene index, the fields with
similar names must be of the same field type even if they are in different
elasticsearch types.

Cheers,

Ivan

On Sun, Nov 24, 2013 at 2:41 AM, Amit Soni amitsoni29@gmail.com wrote:

Hi all - I just observed something weird and was wondering if anyone
else has seen this type of behavior and what might be the possible reason
for the same.

We are using 3 types within a single index. When I execute my
filtered-query against a specific type, I get a few matches. However when I
run the same query but specify all the types, I do not get any documents.

For instance:

Query against http://[host]:9201/index_alias1/type1 ---> Gives me a
few matches

Query against http://[host]:9201/index_alias1/type1, type2, type3
---> Gives me zero matches

Note that these three types have different mappings altogether.

Very curious to know what might be causing this inconsistent behavior.

-Amit.

--
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 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 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/CAAOGaQJ7wr5X1DjYVNNe2Pd2B2cWur4pXCDA59ur-9fBBUQ%2BbA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #6