samvera-deprecated / solrizer

A lightweight, configurable tool for indexing metadata into solr.
Apache License 2.0
30 stars 13 forks source link

Attempting to use insert_field with a non-multivalued field fails. #16

Closed jcoyne closed 11 years ago

jcoyne commented 11 years ago
Solrizer.insert_field(solr_doc, 'title', 'my_title', :sortable)

causes solr_doc to be:

{'title_si' =>['my_title']}

this then causes a solr error:

Error: {'responseHeader'=>{'status'=>400,'QTime'=>2},'error'=>{'msg'=>'ERROR: [doc=mydoc:12] multiple values encountered for non multiValued field title_si: [my_title]','code'=>400}}
awead commented 11 years ago

Should solrizer catch the error before it goes to solr, or should solrizer handle the solr error more gracefully?

cbeer commented 11 years ago

is that really all that's in the solrdoc?

jcoyne commented 11 years ago

@cbeer I'm writing a simplified method of reproducing the error. Of course you'd need id too, but assume that that is added after title_si.

jcoyne commented 11 years ago

@awead I think there's enough information available that we can query the indexer and ask multivalued? then do the right thing.

awead commented 11 years ago

+1