lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <>
Subject Re: Custom Tokenization of a Single Field
Date Tue, 08 Jan 2008 15:08:20 GMT
I *think* you want to consider writing your own analyzer that tokenizes
your special fields however you want to. Then use PerFieldAnalyzerWrapper
at both index and query time to break the stream up appropriately for this
(and only this) field..

This would give you two tokens for the attribute field, "SomeValue" and "1.9
so you'd even be able to express the notion of your attribute field
both "SomeValue" and "1.9".

Hope this helps

On Jan 8, 2008 9:54 AM, Briggs <> wrote:

> I have an index that contains a couple special fields that I need to
> tokenize differently than the rest.   The case is that I basically
> have a key/value pair stored as the value.  The field name is
> "attribute" and it's value is "SomeValue=1.9"
> I need to tokenize the value so that I can search on the field with
> just "SomeValue" (i.e. attribute:SomeValue).   Is it possible to do
> this?  I basically want to tokenize by "=".   The idea that someone
> could search using "attribute:1.9" doesn't matter to me.
> Currently, I am using Compass to do my indexing, but I might have to
> rip it out if this functionality is only available in Lucene proper.
> Hope this is enough info.
> Thanks,
> Briggs
> --
> "Conscious decisions by conscious minds are what make reality real"
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message