Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.9
-
None
Description
Consider the following input document where we have:
- 1 Samsung mobile phone and
- 2 manufactures: Apple and Samsung.
[ { "id":"galaxy note ii", "cat":"product", "manu_s":"samsung" }, { "id":"samsung", "cat":"manufacturer", "name":"Samsung Electronics" }, { "id":"apple", "cat":"manufacturer", "name":"Apple Inc" } ]
My objective is to delete from the default index all manufacturers not having any product in the index.
After indexing ( curl 'http://localhost:8983/solr/update?commit=true' -H "Content-Type: text/json" --data-binary @delete-by-join-query.json )
I went to
http://localhost:8983/solr/select?q=cat:manufacturer -{!join from=manu_s to=id}cat:product
and I could see only Apple, the only manufacturer not having any product in the index.
However, when I use that same query for deletion:
http://localhost:8983/solr/update?commit=true&stream.body=<delete><query>cat:manufacturer -{!join from=manu_s to=id}cat:product</query></delete>
I get
java.lang.ClassCastException: org.apache.lucene.search.IndexSearcher cannot be cast to org.apache.solr.search.SolrIndexSearcher
at org.apache.solr.search.JoinQuery.createWeight(JoinQParserPlugin.java:143)
at org.apache.lucene.search.BooleanQuery$BooleanWeight.<init>(BooleanQuery.java:185)
at org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:526)
at org.apache.lucene.search.BooleanQuery$BooleanWeight.<init>(BooleanQuery.java:185)
at org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:526)
at org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:684)
at org.apache.lucene.search.QueryWrapperFilter.getDocIdSet(QueryWrapperFilter.java:55)
at org.apache.lucene.index.BufferedUpdatesStream.applyQueryDeletes(BufferedUpdatesStream.java:552)
at org.apache.lucene.index.BufferedUpdatesStream.applyDeletesAndUpdates(BufferedUpdatesStream.java:287)
at
This seems to be a bug.
Looking at the source code, the exception is happening in
@Override public Weight createWeight(IndexSearcher searcher) throws IOException { return new JoinQueryWeight((SolrIndexSearcher)searcher); }
Attachments
Attachments
Issue Links
- is broken by
-
SOLR-10986 TestScoreJoinQPScore.testDeleteByScoreJoinQuery() failure: mismatch: '0'!='1' @ response/numFound
- Resolved
- is depended upon by
-
SOLR-6234 Scoring modes for query time join
- Closed
- is related to
-
SOLR-8397 Join query can sometimes throw an exception if highlighted
- Open
-
SOLR-2272 Join
- Closed
- mentioned in
-
Page Loading...