Re: wildcardquery rewrite()

2009-10-07 Thread Robert Muir
Mark, I am set up to do these tests with a large term dict. I will see if there is any improvement. In my opinion in general, even if the improvement is very small, if its trivial to rewrite to a faster/simpler query, we should. Future improvements to lucene might make the simpler query might beco

Re: wildcardquery rewrite()

2009-10-07 Thread Mark Miller
bq. I don't think the prefix enumeration is really that much faster than the wildcard one, We should do some tests. If it is much faster, this would be a nice optimization. I think it could be worth it when matching a lot of terms - never tested though. Robert Muir wrote: > separately, perhaps we

Re: wildcardquery rewrite()

2009-10-07 Thread Robert Muir
sure, I will submit a patch under LUCENE-1951. will look around at other rewrites too just to be sure there arent others Thanks, Robert On Wed, Oct 7, 2009 at 5:15 AM, Michael McCandless wrote: > I agree, this looks like a bug (boost & constant-score-ness is lost) > -- wanna open an issue & pat

Re: wildcardquery rewrite()

2009-10-07 Thread Robert Muir
i think it does this already. so like i said, it would be a minor optimization. On Wed, Oct 7, 2009 at 6:16 AM, Simon Willnauer wrote: > This should be handled in WildcardTermEnum instead of overriding > MultiTermQuery#rewrite(). The WildcardTermEnum could simply return > false in termCompare if

Re: wildcardquery rewrite()

2009-10-07 Thread Simon Willnauer
This should be handled in WildcardTermEnum instead of overriding MultiTermQuery#rewrite(). The WildcardTermEnum could simply return false in termCompare if a term is not equal to the "prefix". This would yield consistent behaviour even if a custom RewriteMethod is used. Right?! simon On Wed, Oct

Re: wildcardquery rewrite()

2009-10-07 Thread Michael McCandless
+1 I think it ought to be faster? PrefixTermEnum just calls .startsWith on each term text, but WildcardTermEnum has big hairy logic in wildcardEquals. Mike On Tue, Oct 6, 2009 at 11:43 PM, Robert Muir wrote: > separately, perhaps we should consider doing the prefixquery rewrite > here for wild

Re: wildcardquery rewrite()

2009-10-07 Thread Michael McCandless
I agree, this looks like a bug (boost & constant-score-ness is lost) -- wanna open an issue & patch it? Mike On Tue, Oct 6, 2009 at 10:22 PM, Robert Muir wrote: > someone asked this question on the user list: > http://www.lucidimagination.com/search/document/6f38de391b242102/prefixquery_vs_wildc

Re: wildcardquery rewrite()

2009-10-06 Thread Robert Muir
separately, perhaps we should consider doing the prefixquery rewrite here for wildcardquery. for example, SolrQueryParser will emit these 'wildcardqueries that should be prefixqueries' if you are using the new reverse stuff for leading wildcards: WildcardQuery(*foobar) -> WildcardQuery(U+0001raboo