I think you're suggesting, for example, "*:* AND -myfield:foo*". If my document contains "myfield:foobar" and "myfield:dog", the document would be thrown out because of the first field. I want to keep the document because the second field does not match.
Related, is there a way to use wildcards to match the beginning of the field? org.apache.lucene.queryParser.ParseException: Cannot parse '*:* AND -myfield:*foo*': '*' or '?' not allowed as first character in WildcardQuery ----- Original Message ---- From: Ian Lea <ian....@gmail.com> To: java-user@lucene.apache.org Sent: Fri, July 30, 2010 9:38:26 AM Subject: Re: InverseWildcardQuery I can't get my head round exactly what you want, but a standard lucene technique is a BooleanQuery holding a MatchAllDocsQuery and a second query, can be anything, having Occur.MUST_NOT. I guess that is a way of inverting the second query. -- Ian. On Fri, Jul 30, 2010 at 3:29 PM, Justin <cry...@yahoo.com> wrote: > Any hints on making something like an InverseWildcardQuery? > > We're trying to find all documents that have at least one field that doesn't > match the wildcard query. > > Or is there a way to inverse any particular query? > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org