Query returns results in ES Head but not Java API after using Update API?

Hello ES folks --

I'm running into an interesting inconsistency (or so it appears) between the same query executed via ElasticSearch Head and the client java API where the query in ES Head returns results as expected but using the Java API, no results are returned. At first I thought it was simply something I'm doing in the JAVA API (i.e. restricting class names or something that you do in the Java API you don't do in ES Head) but after triple checking these, I cannot find the difference.

I suspect it may have to do with how I'm using the java update API on the new value I'm filtering on but can't be sure.

When the index is created, this model is added:

When I run the following query in ES Head, it works:

The same query via the ES Java API (as seen as logging to our console) returns 0 results. This was the query I copied and pasted in ES Head.

The only thing I can think of is that the value that isn't filtering properly in the java api is "altNames" which when I remove the term filter, values come back. I added the value to altNames in the index by calling the update route in the java api.

Is it possible this is an issue with "versions" of the same document? In ES Head, the _version value is 3. This object also is the parent of a parent/child relationship - I'm not sure if that makes a difference.

I am using ES 0.20.6.

I'm a bit stuck - and this only seems to be for terms which I've used the Java update API. I also can't think of any reasons why a query in ES Head would return different results than the same query executed via Java API.

Thanks
Grant

--
Grant Gochnauer | Vodori Inc | grant.gochnauer@vodori.com | (w) 312.324.0124 | (c) 312.504.5004

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

So I started tweaking my query in JAVA, and now I have a query that works
in JAVA too but it's strange why it's working. I simply removed the nested
filter on path. Here is the working query (although now incomplete):

It's strange that the original query works in ES Head but not in JAVA API
and then when I remove the nested filter, it works in JAVA.

Grant

On Tuesday, June 4, 2013 12:46:10 PM UTC-5, Grant Gochnauer wrote:

Hello ES folks --

I'm running into an interesting inconsistency (or so it appears) between
the same query executed via Elasticsearch Head and the client java API
where the query in ES Head returns results as expected but using the Java
API, no results are returned. At first I thought it was simply something
I'm doing in the JAVA API (i.e. restricting class names or something that
you do in the Java API you don't do in ES Head) but after triple checking
these, I cannot find the difference.

I suspect it may have to do with how I'm using the java update API on the
new value I'm filtering on but can't be sure.

When the index is created, this model is added:

Sample ES Model for List question · GitHub

When I run the following query in ES Head, it works:

Query which is failing · GitHub

The same query via the ES Java API (as seen as logging to our console)
returns 0 results. This was the query I copied and pasted in ES Head.

The only thing I can think of is that the value that isn't filtering
properly in the java api is "altNames" which when I remove the term filter,
values come back. I added the value to altNames in the index
by calling the update route in the java api.

Is it possible this is an issue with "versions" of the same document? In
ES Head, the _version value is 3. This object also is the parent of a
parent/child relationship - I'm not sure if that makes a difference.

I am using ES 0.20.6.

I'm a bit stuck - and this only seems to be for terms which I've used the
Java update API. I also can't think of any reasons why a query in ES Head
would return different results than the same query executed via Java API.

Thanks

Grant

--
Grant Gochnauer | Vodori Inc | grant.gochnauer@vodori.com | (w)
312.324.0124 | (c) 312.504.5004

--
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 actually ended up fixing this - turns out the Java API was correct - I
had a bad value in my inbox. For some reason ES Head was returning a match
when it should not have.

In any case, problem solved :wink:

Grant

On Tuesday, June 4, 2013 1:32:05 PM UTC-5, Grant Gochnauer wrote:

So I started tweaking my query in JAVA, and now I have a query that works
in JAVA too but it's strange why it's working. I simply removed the nested
filter on path. Here is the working query (although now incomplete):

Working ES query when excluding nested call · GitHub

It's strange that the original query works in ES Head but not in JAVA API
and then when I remove the nested filter, it works in JAVA.

Grant

On Tuesday, June 4, 2013 12:46:10 PM UTC-5, Grant Gochnauer wrote:

Hello ES folks --

I'm running into an interesting inconsistency (or so it appears) between
the same query executed via Elasticsearch Head and the client java API
where the query in ES Head returns results as expected but using the Java
API, no results are returned. At first I thought it was simply something
I'm doing in the JAVA API (i.e. restricting class names or something that
you do in the Java API you don't do in ES Head) but after triple checking
these, I cannot find the difference.

I suspect it may have to do with how I'm using the java update API on the
new value I'm filtering on but can't be sure.

When the index is created, this model is added:

Sample ES Model for List question · GitHub

When I run the following query in ES Head, it works:

Query which is failing · GitHub

The same query via the ES Java API (as seen as logging to our console)
returns 0 results. This was the query I copied and pasted in ES Head.

The only thing I can think of is that the value that isn't filtering
properly in the java api is "altNames" which when I remove the term filter,
values come back. I added the value to altNames in the index
by calling the update route in the java api.

Is it possible this is an issue with "versions" of the same document? In
ES Head, the _version value is 3. This object also is the parent of a
parent/child relationship - I'm not sure if that makes a difference.

I am using ES 0.20.6.

I'm a bit stuck - and this only seems to be for terms which I've used the
Java update API. I also can't think of any reasons why a query in ES Head
would return different results than the same query executed via Java API.

Thanks

Grant

--
Grant Gochnauer | Vodori Inc | grant.gochnauer@vodori.com | (w)
312.324.0124 | (c) 312.504.5004

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