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 "Adamsky, Robert" <ra...@techtarget.com> on 2010/01/12 15:25:25 UTC

complex multi valued fields

I have a document that has a multi-valued field where each value in
the field itself is comprised of two values itself.  Think of an invoice doc
with multi value line items - each line item having quantity and product name.

One option I see is to have a line item multi value field and when producing
the document to pass to Solr, concat the quantity and desc and put it in the multi
value field.

My preference would be the ability to define such complex multi valued fields
out of the box.  Is that supported in a Solr 1.4 environment?  Basically a field
type that allows you to define the other fields that make up a field.

This could look like something like this in schema.xml if supported:

<field type="complex" name="lineitem">
  <field type="integer" name="quantity"/>
  <field type="text" name="description"/>
</field>


Re: complex multi valued fields

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Tue, Jan 12, 2010 at 7:55 PM, Adamsky, Robert <ra...@techtarget.com>wrote:

>
> I have a document that has a multi-valued field where each value in
> the field itself is comprised of two values itself.  Think of an invoice
> doc
> with multi value line items - each line item having quantity and product
> name.
>
> One option I see is to have a line item multi value field and when
> producing
> the document to pass to Solr, concat the quantity and desc and put it in
> the multi
> value field.
>
> My preference would be the ability to define such complex multi valued
> fields
> out of the box.  Is that supported in a Solr 1.4 environment?  Basically a
> field
> type that allows you to define the other fields that make up a field.
>
> This could look like something like this in schema.xml if supported:
>
> <field type="complex" name="lineitem">
>  <field type="integer" name="quantity"/>
>  <field type="text" name="description"/>
> </field>
>
>
Well, no, atleast not with Solr 1.4. This is a new feature being added to
Solr and it is already in trunk. The existing poly field does not let you
have different types for the individual items but you should be able to
write your own poly field for this task.

-- 
Regards,
Shalin Shekhar Mangar.