lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: Searching for a strict prefix
Date Mon, 24 May 2010 08:32:25 GMT
StandardAnalyzer should work fine, mark the field as indexed, no need
to store it unless you want to retrieve it for display.

Query via QueryParser using "tagname: updateC*" or programatically via
PrefixQuery.


Although I'm not sure exactly what you mean by "strict prefix".  If
you mean that the prefix should match exactly on case, punctuation
etc. maybe use KeywordAnalyzer instead.



--
Ian.


On Sun, May 23, 2010 at 3:03 PM, Shlomy Reinstein <sreinst1@gmail.com> wrote:
> Hi,
>
> I have a Lucene index that contains source code tags (a tag can be any
> named source code element - function, class, variable). Each document
> contains a field with the tag name and some additional information.
> I'd like to be able to perform strict prefix queries. E.g. if I have a
> tag named "updateChildren", I'd like to be able to write a query like
> "updateC*" and get the list of tags that have this prefix
> (updateChildren being one of them).
>
> Is there a way to do this? Please suggest how I should store the field
> for this purpose - which analyzer to use, whether to keep it stored,
> etc.
>
> Thanks,
> Shlomy
>
> ---------------------------------------------------------------------
> 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