On Sep 10, 2007, at 3:07 PM, Mike Klaas wrote:
On 10-Sep-07, at 11:54 AM, melkink wrote:
The other change I made (which may or may not have contributed to the
solution) was to remove all line breaks from the text being
submitted to the
doctext field. The line breaks were causing solr to interpret the
text as
having multiple values and forced me to put a multivalued="true"
attribute
in the schema.xml. Removing the line breaks allowed me to remove
this
attribute.
Interesting--I've never seen this behaviour (I definitely store
fields with linebreaks in strings).
Are you sure that it isn't your own framework that is generating
multiple <field> entries for this input case?
Interestingly the solr-ruby library would create multiple field
versions before I fixed the issue. A document like this:
{:id => 123, :text => "a newline\nin the middle"}
would require "text" to be multiValued. The reason was because the
magic under the covers looks at the field value objects and iterates
over them if they implement the #each method. String#each returns
each _line_ - *sigh* (going away in later versions of Ruby, thank
goodness).
melkink - are you using solr-ruby? If so, that bug has been fixed in
later versions ;)
Erik