lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Khludnev (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-6357) Using query time Join in deleteByQuery throws ClassCastException
Date Thu, 23 Nov 2017 09:45:00 GMT

    [ https://issues.apache.org/jira/browse/SOLR-6357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16264066#comment-16264066
] 

Mikhail Khludnev commented on SOLR-6357:
----------------------------------------

aghh.. could this DQ survive in transaction  log?

> Using query time Join in deleteByQuery throws ClassCastException
> ----------------------------------------------------------------
>
>                 Key: SOLR-6357
>                 URL: https://issues.apache.org/jira/browse/SOLR-6357
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 4.9
>            Reporter: Arcadius Ahouansou
>            Assignee: Mikhail Khludnev
>             Fix For: 7.0
>
>         Attachments: SOLR-6357.patch
>
>
> Consider the following input document where we have:
> - 1 Samsung mobile phone and
> - 2 manufactures: Apple and Samsung.
> {code}
> [
>    {
>       "id":"galaxy note ii",
>       "cat":"product",
>       "manu_s":"samsung"
>    },
>    {
>       "id":"samsung",
>       "cat":"manufacturer",
>       "name":"Samsung Electronics"
>    },
>    {
>       "id":"apple",
>       "cat":"manufacturer",
>       "name":"Apple Inc"
>    }
> ]
> {code}
> 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
> {code}http://localhost:8983/solr/select?q=cat:manufacturer -{!join from=manu_s to=id}cat:product
> {code}
> 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: 
> {code}
> http://localhost:8983/solr/update?commit=true&stream.body=<delete><query>cat:manufacturer
-{!join from=manu_s to=id}cat:product</query></delete>
> {code}
> I get
> {code}
> 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 
> {code}
> This seems to be a bug.
> Looking at the source code, the exception is happening in {code}
>  @Override
>   public Weight createWeight(IndexSearcher searcher) throws IOException {
>     return new JoinQueryWeight((SolrIndexSearcher)searcher);
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message