You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by Ayende Rahien <ay...@ayende.com> on 2010/08/08 02:01:55 UTC

Prefix query performance

I run into an interesting perf issue just now.

100 runs of this query: "Name:WILLY" @ 224ms
100 runs of this query: "Name:WIL*" @ 790ms

There are ~5000 documents in the index, two fields, Name is using
StandardAnalyzer.

Is there supposed to be that big a perf difference between the two?

Re: Prefix query performance

Posted by Daniel Wertheim <da...@wertheim.se>.
The first query is parsed as a TermQuery whilst the second as a PrefixQuery
(since it only contains a trailing asterisk). Don't know about PrefixQueries
if they are the same as WildcardQueries in the sence where a larger prefix
decreases the number of terms it needs to enumerate to find matches.

Look at 3.4.7 & 3.5.5 in Lucene in Action.

//Daniel

2010/8/8 Ayende Rahien <ay...@ayende.com>

> I run into an interesting perf issue just now.
>
> 100 runs of this query: "Name:WILLY" @ 224ms
> 100 runs of this query: "Name:WIL*" @ 790ms
>
> There are ~5000 documents in the index, two fields, Name is using
> StandardAnalyzer.
>
> Is there supposed to be that big a perf difference between the two?
>