You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Lance Lance <go...@gmail.com> on 2007/07/19 23:35:38 UTC
comma-separated multivalued field
Hi-
I'd like to make a multivalued field of comma-separated phrases. Is there a
class available that I can use for this?
I can see how to create N separate elements for the same field in the update
XML, but is there something I can use in type definition?
Thanks,
Lance
Re: comma-separated multivalued field
Posted by Ryan McKinley <ry...@gmail.com>.
Lance Lance wrote:
> Hi-
>
> I'd like to make a multivalued field of comma-separated phrases. Is there a
> class available that I can use for this?
> I can see how to create N separate elements for the same field in the update
> XML, but is there something I can use in type definition?
>
If you are just talking about what tokens are indexed (and therefor
searchable), use a PatternTokenizerFactory and split on ","
If you want to index:
<field name="content">aaa, bbb, ccc</field>
And get back:
<arr name="content">
<str>aaa</str>
<str>bbb</str>
<str>ccc</str>
</arr>
There is nothing off the shelf to do this. In the latest dev source,
there is a place to do this kind of transformation, but it is still
brand new. If interested, check the UpdateRequestProcessor.
ryan