lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Best approach for exact Prefix Field Query
Date Tue, 14 Nov 2006 13:37:52 GMT
Martin,

SpanFirstQuery is what you're after.

	Erik


On Nov 14, 2006, at 8:32 AM, Martin Braun wrote:

> hi,
>
> i would like to provide a exact "PrefixField Search", i.e. a search  
> for
> exactly the first words in a field.
> I think I can't use a PrefixQuery because it would find also  
> substrings
> inside the field, e.g.
> action* would find titles like "Action and knowledge" but also (that's
> what i don't want it to find)
> "Lucene in Action"
>
> As a regex it would be sth. like /^Action and.*/
>
> Now the question for me is how to implement this functionality, I  
> see to
> ways:
>
> 1) Some kind of TermEnum over all Docs (or the prefixquery  
> results?) and
> string comparison
> 2) Using the regex contribution
> 3) a super -fast lucene function I have overseen :)
>
> with 2) I am worrying about performance, anybody have experiences with
> regex-queries?
>
> .. but same for 1) anybody already impolemented this already and could
> give some code samples / hints ?
>
> tia,
>
>
> martin
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message