I'm getting this error using the TopChildrenQuery:
ClassCastException[org.elasticsearch.index.search.child.TopChildrenQuery
cannot be cast to org.elasticsearch.index.search.child.HasChildFilter];
Debugging, i found the error to happen in this line:
Which seems weird, why would it convert to HasChildFilter there? Shouldn't
it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
I've done few tests.
Changing the casting to TopChildrenQuery did stop the error, but i'm not
sure about side effects, i'll look more into it.
Something also weird is that the .equals() method on XFilteredQuery can
return false when compared with itself.
So, i actually need to change the equals method on TopChildrenQuery
to: TopChildrenQueryEquals.java · GitHub
This is just some experimentations, trying to see any side effect.
On Wednesday, July 3, 2013 10:27:43 AM UTC-3, Rodrigo Ribeiro wrote:
I'm getting this error using the TopChildrenQuery:
ClassCastException[org.elasticsearch.index.search.child.TopChildrenQuery
cannot be cast to org.elasticsearch.index.search.child.HasChildFilter];
Debugging, i found the error to happen in this line:
Which seems weird, why would it convert to HasChildFilter there? Shouldn't
it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
That is an epic 'copy-paste' bug... It isn't only TopChildrenQuery, but
also in the ChildrenQuery and ParentQuery classes. I will open an issue
soon and fix this. Thanks for reporting this.
Btw: How are you using the top_children query in your search requests? Are
you wrapping it in a fquery filter?
I've done few tests.
Changing the casting to TopChildrenQuery did stop the error, but i'm not
sure about side effects, i'll look more into it.
Something also weird is that the .equals() method on XFilteredQuery can
return false when compared with itself.
So, i actually need to change the equals method on TopChildrenQuery to: TopChildrenQueryEquals.java · GitHub
This is just some experimentations, trying to see any side effect.
On Wednesday, July 3, 2013 10:27:43 AM UTC-3, Rodrigo Ribeiro wrote:
I'm getting this error using the TopChildrenQuery:
ClassCastException[org.**elasticsearch.index.search.**child.TopChildrenQuery
cannot be cast to org.elasticsearch.index.**search.child.HasChildFilter];
Which seems weird, why would it convert to HasChildFilter there?
Shouldn't it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
That is an epic 'copy-paste' bug... It isn't only TopChildrenQuery, but
also in the ChildrenQuery and ParentQuery classes. I will open an issue
soon and fix this. Thanks for reporting this.
Btw: How are you using the top_children query in your search requests? Are
you wrapping it in a fquery filter?
I've done few tests.
Changing the casting to TopChildrenQuery did stop the error, but i'm not
sure about side effects, i'll look more into it.
Something also weird is that the .equals() method on XFilteredQuery can
return false when compared with itself.
So, i actually need to change the equals method on TopChildrenQuery to: TopChildrenQueryEquals.java · GitHub
This is just some experimentations, trying to see any side effect.
On Wednesday, July 3, 2013 10:27:43 AM UTC-3, Rodrigo Ribeiro wrote:
I'm getting this error using the TopChildrenQuery:
ClassCastException[org.**elasticsearch.index.search.child.TopChildrenQuery
cannot be cast to org.elasticsearch.index.
search.child.HasChildFilter];
Which seems weird, why would it convert to HasChildFilter there?
Shouldn't it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
The first error was fixed, but now i'm running in another problem, the one
that I mention before about XFilteredQuery.
The following comparison returns false, even originalChildQuery and that.originalChildQuery being the same instance:
This is a problem for the rewrite() method of the TopChildQuery, cause it
do a indexOf and can't found the query, resulting on
a ArrayIndexOutOfBoundsException later:
That is an epic 'copy-paste' bug... It isn't only TopChildrenQuery, but
also in the ChildrenQuery and ParentQuery classes. I will open an issue
soon and fix this. Thanks for reporting this.
Btw: How are you using the top_children query in your search requests?
Are you wrapping it in a fquery filter?
On 3 July 2013 18:42, Rodrigo Ribeiro <rodri...@jusbrasil.com.br<javascript:>
wrote:
I've done few tests.
Changing the casting to TopChildrenQuery did stop the error, but i'm not
sure about side effects, i'll look more into it.
Something also weird is that the .equals() method on XFilteredQuery can
return false when compared with itself.
So, i actually need to change the equals method on TopChildrenQuery to: TopChildrenQueryEquals.java · GitHub
This is just some experimentations, trying to see any side effect.
On Wednesday, July 3, 2013 10:27:43 AM UTC-3, Rodrigo Ribeiro wrote:
I'm getting this error using the TopChildrenQuery:
ClassCastException[org.**elasticsearch.index.search.child.TopChildrenQuery
cannot be cast to org.elasticsearch.index.
search.child.HasChildFilter];
Which seems weird, why would it convert to HasChildFilter there?
Shouldn't it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
Thanks.
--
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 <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
I think that the following code in TopChildrenQuery#equals() is correct:
TopChildrenQuery that = (TopChildrenQuery) obj;
if (!originalChildQuery.equals(that.originalChildQuery)) {
return false;
}
All Query impl should have the following code, that returns in the case the
instance is the same:
if (this == obj) {
return true;
}
So I wouldn't expect that TopChildrenQuery#equals method to be a problem.
What query are you wrapping in the top_children query in your gist?
This is a problem for the rewrite() method of the TopChildQuery, cause it
do a indexOf and can't found the query, resulting on
a ArrayIndexOutOfBoundsException later:
That is an epic 'copy-paste' bug... It isn't only TopChildrenQuery, but
also in the ChildrenQuery and ParentQuery classes. I will open an issue
soon and fix this. Thanks for reporting this.
Btw: How are you using the top_children query in your search requests?
Are you wrapping it in a fquery filter?
On Wednesday, July 3, 2013 10:27:43 AM UTC-3, Rodrigo Ribeiro wrote:
I'm getting this error using the TopChildrenQuery:
ClassCastException[org.elasticsearch.index.search.**child.**TopChildrenQuery
cannot be cast to org.elasticsearch.index.search
.child.HasChildFilter];
Which seems weird, why would it convert to HasChildFilter there?
Shouldn't it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
Thanks.
--
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.
On Thursday, July 4, 2013 7:31:26 AM UTC-3, Martijn v Groningen wrote:
I think that the following code in TopChildrenQuery#equals() is correct:
TopChildrenQuery that = (TopChildrenQuery) obj;
if (!originalChildQuery.equals(that.originalChildQuery)) {
return false;
}
All Query impl should have the following code, that returns in the case
the instance is the same:
if (this == obj) {
return true;
}
So I wouldn't expect that TopChildrenQuery#equals method to be a problem.
What query are you wrapping in the top_children query in your gist?
On 3 July 2013 23:06, Rodrigo Ribeiro <rodri...@jusbrasil.com.br<javascript:>
wrote:
Thanks Martjn,
The first error was fixed, but now i'm running in another problem, the
one that I mention before about XFilteredQuery.
The following comparison returns false, even originalChildQuery and that.originalChildQuery being the same instance:
This is a problem for the rewrite() method of the TopChildQuery, cause it
do a indexOf and can't found the query, resulting on
a ArrayIndexOutOfBoundsException later:
That is an epic 'copy-paste' bug... It isn't only TopChildrenQuery, but
also in the ChildrenQuery and ParentQuery classes. I will open an issue
soon and fix this. Thanks for reporting this.
Btw: How are you using the top_children query in your search requests?
Are you wrapping it in a fquery filter?
On Wednesday, July 3, 2013 10:27:43 AM UTC-3, Rodrigo Ribeiro wrote:
I'm getting this error using the TopChildrenQuery:
ClassCastException[org.elasticsearch.index.search.**child.**TopChildrenQuery
cannot be cast to org.elasticsearch.index.search
.child.HasChildFilter];
Which seems weird, why would it convert to HasChildFilter there?
Shouldn't it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
Thanks.
--
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.
I don't think that the XFilteredQuery#equals method is a problem, since it
delegates all calls to FilteredQuery#equals (delegate).
I assume that you are using search_type with option dfs_query_then_fetch, right?
Also what elasticsearch version are you using?
On Thursday, July 4, 2013 7:31:26 AM UTC-3, Martijn v Groningen wrote:
I think that the following code in TopChildrenQuery#equals() is correct:
TopChildrenQuery that = (TopChildrenQuery) obj;
if (!originalChildQuery.equals(**that.originalChildQuery)) {
return false;
}
All Query impl should have the following code, that returns in the case
the instance is the same:
if (this == obj) {
return true;
}
So I wouldn't expect that TopChildrenQuery#equals method to be a problem.
What query are you wrapping in the top_children query in your gist?
That is an epic 'copy-paste' bug... It isn't only TopChildrenQuery,
but also in the ChildrenQuery and ParentQuery classes. I will open an issue
soon and fix this. Thanks for reporting this.
Btw: How are you using the top_children query in your search requests?
Are you wrapping it in a fquery filter?
On Wednesday, July 3, 2013 10:27:43 AM UTC-3, Rodrigo Ribeiro wrote:
I'm getting this error using the TopChildrenQuery:
ClassCastException[org.elastic****search.index.search.child.
TopChildrenQuery cannot be cast to org.elasticsearch.index.**
search****.child.HasChildFilter];
Which seems weird, why would it convert to HasChildFilter there?
Shouldn't it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
Thanks.
--
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.
Yes, i'm using dfs_query_then_fetch.
Now that you mention, i tried with just query_then_fetch, and it
works(maybe it is not caching something)
I'm using 0.90.1.
I did mention the equals cause the delegate was a instance
of org.apache.lucene.search.FilteredQuery, and was being compared with
a XFilteredQuery object.
The comparison failed on an if (getClass() != obj.getClass()) check from
org.apache.lucene.search.Query#equals
Thanks for your help so far mate.
On Thursday, July 4, 2013 1:28:59 PM UTC-3, Martijn v Groningen wrote:
I don't think that the XFilteredQuery#equals method is a problem, since it
delegates all calls to FilteredQuery#equals (delegate).
I assume that you are using search_type with option dfs_query_then_fetch, right?
Also what elasticsearch version are you using?
On 4 July 2013 16:15, Rodrigo Ribeiro <rodri...@jusbrasil.com.br<javascript:>
wrote:
I agree with you about the TopChildrenQuery#equals method.
On Thursday, July 4, 2013 7:31:26 AM UTC-3, Martijn v Groningen wrote:
I think that the following code in TopChildrenQuery#equals() is correct:
TopChildrenQuery that = (TopChildrenQuery) obj;
if (!originalChildQuery.equals(**that.originalChildQuery)) {
return false;
}
All Query impl should have the following code, that returns in the case
the instance is the same:
if (this == obj) {
return true;
}
So I wouldn't expect that TopChildrenQuery#equals method to be a
problem. What query are you wrapping in the top_children query in your gist?
That is an epic 'copy-paste' bug... It isn't only TopChildrenQuery,
but also in the ChildrenQuery and ParentQuery classes. I will open an issue
soon and fix this. Thanks for reporting this.
Btw: How are you using the top_children query in your search
requests? Are you wrapping it in a fquery filter?
On Wednesday, July 3, 2013 10:27:43 AM UTC-3, Rodrigo Ribeiro wrote:
I'm getting this error using the TopChildrenQuery:
ClassCastException[org.elastic****search.index.search.child.
TopChildrenQuery cannot be cast to org.elasticsearch.index.**
search****.child.HasChildFilter];
Which seems weird, why would it convert to HasChildFilter there?
Shouldn't it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
Thanks.
--
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.
This seems like a bug (with the dfs_* search type). I suspect that the
query rewrite is causing this. The TopChildrenQuery#rewrite method looks
wrong. This part:
if (rewritten == rewrittenChildQuery) {
return this;
}
I haven't been able to reproduce the error that you've encountered, but I
will update the TopChildrenQuery#rewrite method.
Yes, i'm using dfs_query_then_fetch.
Now that you mention, i tried with just query_then_fetch, and it
works(maybe it is not caching something)
I'm using 0.90.1.
I did mention the equals cause the delegate was a instance
of org.apache.lucene.search.FilteredQuery, and was being compared with
a XFilteredQuery object.
The comparison failed on an if (getClass() != obj.getClass()) check from
org.apache.lucene.search.Query#equals
Thanks for your help so far mate.
On Thursday, July 4, 2013 1:28:59 PM UTC-3, Martijn v Groningen wrote:
I don't think that the XFilteredQuery#equals method is a problem, since
it delegates all calls to FilteredQuery#equals (delegate).
I assume that you are using search_type with option dfs_query_then_fetch, right?
Also what elasticsearch version are you using?
On Thursday, July 4, 2013 7:31:26 AM UTC-3, Martijn v Groningen wrote:
I think that the following code in TopChildrenQuery#equals() is correct:
TopChildrenQuery that = (TopChildrenQuery) obj;
if (!originalChildQuery.equals(that.originalChildQuery)) {
return false;
}
All Query impl should have the following code, that returns in the case
the instance is the same:
if (this == obj) {
return true;
}
So I wouldn't expect that TopChildrenQuery#equals method to be a
problem. What query are you wrapping in the top_children query in your gist?
That is an epic 'copy-paste' bug... It isn't only TopChildrenQuery,
but also in the ChildrenQuery and ParentQuery classes. I will open an issue
soon and fix this. Thanks for reporting this.
Btw: How are you using the top_children query in your search
requests? Are you wrapping it in a fquery filter?
On Wednesday, July 3, 2013 10:27:43 AM UTC-3, Rodrigo Ribeiro wrote:
I'm getting this error using the TopChildrenQuery:
ClassCastException[org.elasticsearch.index.search.**child.
**TopChildrenQuery cannot be cast to org.elasticsearch.index.* search*****.child.HasChildFilter];
Which seems weird, why would it convert to HasChildFilter there?
Shouldn't it be casting to TopChildrenQuery?
If it is a bug, i can submit the issue/pull-request fixing.
Thanks.
--
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.