Solr 7.5 multi-valued fields will not update with multiple values

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

Solr 7.5 multi-valued fields will not update with multiple values

Eivind Hodneland

Hi,

 

I am running a Solr 7.5 index for a customer.

I have recently discovered that none of the multivalued string/text fields are filled with more than one value each.

 

Example of indexing (edited and abbreviated):

curl -X POST -H 'Content-Type: application/json' 'http://localhost:18080/solr/customer_core/update/' --data-binary '[{"id":"MyId","author_fullname":["Author 1","Author 2”,”Author 3”]}]'

 

The multivalued field author_fullname only gets one value, namely “Author 1”.

This is also the case for the other multivalued fields in the schema.

 

Definition of author_fullname and its corresponding type from managed-schema:

 

  <field name="author_fullname" type="MyType" multiValued="true" indexed="true" stored="true"/>

 

 

<fieldType name="MyType" class="solr.TextField" positionIncrementGap="100">

    <analyzer type="index">

      <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>

      <tokenizer class="solr.StandardTokenizerFactory"/>

      <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>

      <filter class="solr.LowerCaseFilterFactory"/>

    </analyzer>

    <analyzer type="query">

      <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>

      <tokenizer class="solr.StandardTokenizerFactory"/>

      <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>

      <filter class="solr.LowerCaseFilterFactory"/>

    </analyzer>

  </fieldType>

 

Uptime Consulting | Eivind Hodneland | Senior Consultant | Munchs gate 7, NO-0165 Oslo, Norway

Tel: +47 22 33 71 00 | Mob: +47 971 76 083 | [hidden email]  www.uptimeconsulting.no

----------------------------------------------------------------------

Search and Big Data solutions

Software Development

IT outsourcing services and consultancy

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Solr 7.5 multi-valued fields will not update with multiple values

Erick Erickson
Separate out the author bits. Instead of

"author_fullname":["Author 1","Author 2”,”Author 3”]

use

"author_fullname":"Author 1”,
"author_fullname":"Author 2”,
"author_fullname":”Author 3”

> On Mar 29, 2019, at 6:16 AM, Eivind Hodneland <[hidden email]> wrote:
>
> curl -X POST -H 'Content-Type: application/json' 'http://localhost:18080/solr/customer_core/update/' --data-binary '[{"id":"MyId","author_fullname":["Author 1","Author 2”,”Author 3”]}]'