You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Erick Erickson (JIRA)" <ji...@apache.org> on 2019/02/22 16:08:00 UTC

[jira] [Commented] (SOLR-13267) complex {!graph query: NullPointerException

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

Erick Erickson commented on SOLR-13267:
---------------------------------------

Out of curiosity, what happens if you replace "AND NOT" with just "NOT"? Solr/Lucene do not implement pure boolean logic, so the "AND" is unnecessary. See: https://lucidworks.com/2011/12/28/why-not-and-or-and-not/

NOTE: "AND NOT" should work, but just "NOT" works that's both a work-around and a pointer where the problem is.

Oh, and please post the stack trace.

> complex {!graph query: NullPointerException
> -------------------------------------------
>
>                 Key: SOLR-13267
>                 URL: https://issues.apache.org/jira/browse/SOLR-13267
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 7.7
>            Reporter: Jochen Barth
>            Priority: Major
>
> this query leads to NullPointerException:
> (\{!graph from=id to=parent_ids}fulltext_ocr_txtlarge:phoron
> AND \{!graph from=id to=parent_ids}fulltext_ocr_txtlarge:terrae)
> AND NOT (\{!graph from=id to=parent_ids returnRoot=false}
> (\{!graph from=id to=parent_ids}fulltext_ocr_txtlarge:phoron AND
> {!graph from=id to=parent_ids}fulltext_ocr_txtlarge:terrae))
> It is essentially the query
> X = \{!graph from=id to=parent_ids}fulltext_ocr_txtlarge:phoron
> AND \{!graph from=id to=parent_ids}fulltext_ocr_txtlarge:terrae
> (X) AND NOT (\{!graph from=id to=parent_ids returnRoot=false}(X))
> parent_ids is a multiValued string docValue-Field; fulltext_ocr_txtlarge is essentially like the *_txt field.
> Use case is: hierarchical solr-docs, think book, chapter, subchapter etc. Each containing fulltext_ocr_txtlarge with the fulltext of this element only. So higher level elements (e. g. book) does not contain the fulltext of lower level elements (e. g. chapters).
> The query X delivers all chapters with both words, but of course higher level elements, too, because the whole book has always more text than single chapters.
> the »AND NOT ({!graph ... « part is to filter out the unecessary results, like »book« if a chapter already matches.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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