> assuming that you mistakenly used the same field name Nope, wasn't a mistake. We'd have to dynamically iterate through an unknown number of fields if we didn't use the same one.
----- Original Message ---- From: Steven A Rowe <sar...@syr.edu> To: "java-user@lucene.apache.org" <java-user@lucene.apache.org> Sent: Fri, July 30, 2010 11:14:17 AM Subject: RE: InverseWildcardQuery Hi Justin, > [...] "*:* 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. I'm assuming that you mistakenly used the same field name above in ("myfield:foobar" and "myfield:dog"), and that you instead meant: "myfield1:foobar" and "myfield2:dog". I think you can get what you want by specifying every field in the query - e.g., if each document has the same set of two fields F1 and F2: (*:* AND -F1:foo*) OR (*:* AND -F2:foo*) Truth table for four documents: Doc1: F1:foobar (no-match), F2:dog (match) => match Doc2: F1:cat (match), F2:dog (match) => match Doc3: F1:cat (match), F2:foosball (no-match) => match Doc4: F1:foobar (no-match), F2:foosball (no-match) => no-match Good luck, Steve --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org