How do I add multiple values for same field with DIH script?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I add multiple values for same field with DIH script?

O. Klein
row.put('content_text', "hello");
row.put('content_text', "this is a test");
return row;

will only return "this is a test"




--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: How do I add multiple values for same field with DIH script?

Mikhail Khludnev-2
Hello.
What about putting Arrays.asList("foo", "bar") ?

On Thu, Jan 16, 2020 at 2:42 PM O. Klein <[hidden email]> wrote:

> row.put('content_text', "hello");
> row.put('content_text', "this is a test");
> return row;
>
> will only return "this is a test"
>
>
>
>
> --
> Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>


--
Sincerely yours
Mikhail Khludnev
Reply | Threaded
Open this post in threaded view
|

Re: How do I add multiple values for same field with DIH script?

Edward Ribeiro
In reply to this post by O. Klein
Hi,

Are you sure content_text is a multivalued field (i.e., field definition has
multiValued="true" in managed-schema)?

Edward


Em qui, 16 de jan de 2020 08:42, O. Klein <[hidden email]> escreveu:

> row.put('content_text', "hello");
> row.put('content_text', "this is a test");
> return row;
>
> will only return "this is a test"
>
>
>
>
> --
> Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
Reply | Threaded
Open this post in threaded view
|

Re: How do I add multiple values for same field with DIH script?

O. Klein
Yes, field is multivalued.

I managed to add an array to the content_text field and comma separated
values "foo,bar" eg. but not a " list" like normally you see with a
multivalued field.



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html