I wrote a small app that entirely uses Lucene and MUST_NOT works fine. On the 
other hand I have no problem using the NOT statement you suggested.

However, I think neo4j should not throw a NPE there. A more comprehensive 
exception would be nice


-------- Original-Nachricht --------
> Datum: Fri, 7 Oct 2011 22:30:00 +0200
> Von: Michael Hunger <[email protected]>
> An: Neo4j user discussions <[email protected]>
> Betreff: Re: [Neo4j] MUST_NOT in Index.query leads to NPE

> I haven't found any lucene docs that describe the use of MUST_NOT in
> queries:
> 
> what I found was:
> http://semeru2007.wordpress.com/2007/10/17/lucene-an-introduction/
> 
> which would applied to your query mean:
> > StreetAddress:"Kurfürstendamm 41" AND City:"Zwickau" AND State:"SN" AND
> ZipCode:"08001" AND Country:"DE" AND 
> -UUID:"03df5826-5236-4075-86dd-1d121e127ade"
> 
> 
> Am 07.10.2011 um 22:05 schrieb D. Frej:
> 
> > the final query looks like
> > 
> > StreetAddress:"Kurfürstendamm 41" AND City:"Zwickau" AND State:"SN" AND
> ZipCode:"08001" AND Country:"DE" AND UUID:MUST_NOT
> "03df5826-5236-4075-86dd-1d121e127ade"
> > 
> > My nodes only have properties of type String
> > 
> > 
> > 
> > -------- Original-Nachricht --------
> >> Datum: Fri, 7 Oct 2011 20:50:25 +0200
> >> Von: Michael Hunger <[email protected]>
> >> An: Neo4j user discussions <[email protected]>
> >> Betreff: Re: [Neo4j] MUST_NOT in Index.query leads to NPE
> > 
> >> What value is your uuid in that case? is it probably null or empty?
> >> 
> >> Can we see the final query string?
> >> 
> >> Am 07.10.2011 um 20:25 schrieb [email protected]:
> >> 
> >>> Hi everybody,
> >>> 
> >>> I want to query the Index with the Method query(String). Therefore, I
> >> build my query and execute the method:
> >>> 
> >>> StringBuffer query = new StringBuffer();
> >>> ...
> >>> query.append(" AND ");
> >>> query.append("UUID:");
> >>> query.append("MUST_NOT ");
> >>> query.append("\"" + uuid + "\"");
> >>> 
> >>> IndexHits<Node> hits = nodeIndex.query(query.toString());
> >>> 
> >>> This leads to the following Exception:
> >>> 
> >>> Exception in thread "main" java.lang.NullPointerException
> >>>   at
> >>
> org.apache.lucene.util.SimpleStringInterner.intern(SimpleStringInterner.java:54)
> >>>   at org.apache.lucene.util.StringHelper.intern(StringHelper.java:36)
> >>>   at org.apache.lucene.index.Term.<init>(Term.java:38)
> >>>   at
> >>
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:643)
> >>>   at
> >>
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:752)
> >>>   at
> >> org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1556)
> >>>   at
> >> org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1309)
> >>>   at
> >> org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1266)
> >>>   at
> >>
> org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1226)
> >>>   at
> >> org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
> >>>   at org.neo4j.index.impl.lucene.IndexType.query(IndexType.java:281)
> >>>   at
> org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:207)
> >>>   at
> org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:218)
> >>>   at testdata.ReadTestData.listInformation(ReadTestData.java:112)
> >>>   at testdata.ReadTestData.main(ReadTestData.java:153)
> >>> 
> >>> The syntax of the build query is correct - at least it executes in
> Luke
> >> (https://code.google.com/p/luke/) without complaining.
> >>> 
> >>> Am I doing something wrong or did I miss something?
> >>> 
> >>> Cheers,
> >>> 
> >>> Didi
> >>> -- 
> >>> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> >>> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> >>> _______________________________________________
> >>> Neo4j mailing list
> >>> [email protected]
> >>> https://lists.neo4j.org/mailman/listinfo/user
> >> 
> >> _______________________________________________
> >> Neo4j mailing list
> >> [email protected]
> >> https://lists.neo4j.org/mailman/listinfo/user
> > 
> > -- 
> > NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!           
> > Jetzt informieren: http://www.gmx.net/de/go/freephone
> > _______________________________________________
> > Neo4j mailing list
> > [email protected]
> > https://lists.neo4j.org/mailman/listinfo/user
> 
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user

-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!               
Jetzt informieren: http://www.gmx.net/de/go/freephone
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to