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 Siddharth Gargate <si...@gmail.com> on 2012/01/27 07:32:32 UTC

addBean method inserting multivalued values

Hi,
I have annotated the setter methods with Field annotations. And I am using
addBean method to add SOLR document. But all fields are being indexed as
multivalued:
<doc>
<float name="score">1.0</float>
<arr name="id">
<str>1</str>
</arr>

<arr name="name">
<str>siddharth 0</str>
</arr>
<arr name="updated_dt">
<date>2012-01-28T06:22:19.946Z</date>
</arr>
</doc>

How to avoid this?

Re: addBean method inserting multivalued values

Posted by Siddharth Gargate <si...@gmail.com>.
I have not specified the multivalued attribute.
 <dynamicField name="*_i" type="integer" indexed="true" stored="true"/>

I have different integer properties in my java class, some are single
integer values, some are integer arrays. What I want is if the setter
method is expecting an integer then the field stored must be single valued.
But all integer dynamic fields are being indexed as multivalued.
Please not that this happens only when I use addBeans method. If I
construct a SolrDocument then indexing works as expected.


On Wed, Feb 1, 2012 at 3:43 PM, darul <da...@gmail.com> wrote:

> remove multivalue="true" in your schema.xml file ?
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/addBean-method-inserting-multivalued-values-tp3692511p3706126.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: addBean method inserting multivalued values

Posted by darul <da...@gmail.com>.
remove multivalue="true" in your schema.xml file ?

--
View this message in context: http://lucene.472066.n3.nabble.com/addBean-method-inserting-multivalued-values-tp3692511p3706126.html
Sent from the Solr - User mailing list archive at Nabble.com.