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 darul <da...@gmail.com> on 2011/10/03 18:12:18 UTC

SolrJ Annotation for multiValued field

Hello again,

Is it possible to persist simple list values in index using annotated bean ?

<field name="mymultivaluedfield" type="text" indexed="true" stored="true"
multiValued="true"/> 

And in my Pojo :

@Field("one")
String myString
.....
....

@Field("mymultivaluedfield")
List<String> items;

Actually, nothing happends, content of this collection "ArrayList<String>"
is not persisted into mymultivaluedfield field.

Is it the problem of nested field I have seen in many threads.

Any solutions to persist multivalue field with annotated bean ?

Thanks

--
View this message in context: http://lucene.472066.n3.nabble.com/SolrJ-Annotation-for-multiValued-field-tp3390255p3390255.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SolrJ Annotation for multiValued field

Posted by darul <da...@gmail.com>.
well, another mistake, it works...sorry ;)

--
View this message in context: http://lucene.472066.n3.nabble.com/SolrJ-Annotation-for-multiValued-field-tp3390255p3392652.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SolrJ Annotation for multiValued field

Posted by darul <da...@gmail.com>.
I will check tomorrow, but for a test case, I have put this code to verify
Field List mapping :

@Field("mymultivaluedfield") 
List items; 

public List getItems() {
   if (items == null) {
     items = new ArrayList();
     items.add("value1");
     ....
   }
  return items;
}

Is it normal it does not persist with this syntax.

A better may be to use myBean.setItems() ?

--
View this message in context: http://lucene.472066.n3.nabble.com/SolrJ-Annotation-for-multiValued-field-tp3390255p3390930.html
Sent from the Solr - User mailing list archive at Nabble.com.