Re: query for non-existence of fields

2011-10-05 Thread Ian Lea
MatchAllDocsQuery. It's in the FAQ. http://wiki.apache.org/lucene-java/LuceneFAQ#How_does_one_determine_which_documents_do_not_have_a_certain_term.3F -- Ian. On Wed, Oct 5, 2011 at 8:11 PM, Sam Jiang wrote: > Hi > > I'm struggling to figure out a way to query for the non-existence of some > fi

query for non-existence of fields

2011-10-05 Thread Sam Jiang
Hi I'm struggling to figure out a way to query for the non-existence of some fields. e.g. matches all documents that doesn't contain field X I tried: BooleanQuery q = new BooleanQuery(); q.add(new BooleanClause( new TermQuery(new Term("fieldName", "*")),