Re: InverseWildcardQuery

2010-07-30 Thread Justin
workaround. I'm just trying to avoid going down the wrong path. > Query.html#rewrite So it sounds like I should attempt to write my own InverseWildcardQuery class which overrides this method. Perhaps I can use WildcardQuery as an example? WildcardQuery has changed parent classes over

RE: InverseWildcardQuery

2010-07-30 Thread Steven A Rowe
> > you want what Lucene already does, but that's clearly not true > > Hmmm, let's pretend that "contents" field in my example wasn't analyzed at > index > time. The unstemmed form of terms will be indexed. But if I query with a > stemmed > form or use QueryParser with the SnowballAnalyzer, I'm

Re: InverseWildcardQuery

2010-07-30 Thread Justin
]" may appear any number of times where PREFIX comes from the set { A, B, C, D, E, ... }. This complexity is really a tangent of my question in order to avoid poor performance from WildcardQuery. - Original Message From: Steven A Rowe To: "java-user@lucene.apache.org

RE: InverseWildcardQuery

2010-07-30 Thread Steven A Rowe
Hi Justin, > > an example > > PerFieldAnalyzerWrapper analyzers = > new PerFieldAnalyzerWrapper(new KeywordAnalyzer()); > // myfield defaults to KeywordAnalyzer > analyzers.addAnalyzer("content", new SnowballAnalyzer(luceneVersion, > "English")); > // analyzers affects the indexed field valu

Re: InverseWildcardQuery

2010-07-30 Thread Justin
> Can you turn those prefixes into field names No, the prefixes are not discrete. Multiple field values could start with the same prefix. Writing something like InverseWildcardQuery seems like the most appropriate solution. My thought to have another Analyzer used on the field value at search

RE: InverseWildcardQuery

2010-07-30 Thread Steven A Rowe
Hi Justin, > Unfortunately the suffix requires a wildcard as well in our case. There > are a limited number of prefixes though (10ish), so perhaps we could > combine them all into one query. We'd still need some sort of > InverseWildcardQuery implementation. > > > u

Re: InverseWildcardQuery

2010-07-30 Thread Justin
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 wan

RE: InverseWildcardQuery

2010-07-30 Thread Steven A Rowe
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 n

Re: InverseWildcardQuery

2010-07-30 Thread Justin
> indexing your terms in reverse Unfortunately the suffix requires a wildcard as well in our case. There are a limited number of prefixes though (10ish), so perhaps we could combine them all into one query. We'd still need some sort of InverseWildcardQuery implementation. >

RE: InverseWildcardQuery

2010-07-30 Thread Uwe Schindler
hetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Ian Lea [mailto:ian@gmail.com] > Sent: Friday, July 30, 2010 5:33 PM > To: java-user@lucene.apache.org > Subject: Re: InverseWildcardQuery > > > I think you're suggesting, for example, "*:* A

Re: InverseWildcardQuery

2010-07-30 Thread Ian Lea
> I think you're suggesting, for example, "*:* AND -myfield:foo*". Yes, I think that is equivalent. > 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.

Re: InverseWildcardQuery

2010-07-30 Thread Justin
: 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 gues

Re: InverseWildcardQuery

2010-07-30 Thread Ian Lea
ustin 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 wa

InverseWildcardQuery

2010-07-30 Thread Justin
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 partic