lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <karl.wri...@nokia.com>
Subject Solr posting question
Date Thu, 12 Jul 2012 20:17:53 GMT
Hi all,

I received a report of a problem with posting data to Solr.  The post method is a multi-part
form, so if you inspect it, it looks something like this:

>>>>>>
----boundary---
Content-Disposition: form-data; name=metadata_attribute_name
Content-Type: text; charset=utf-8

abc;def;ghi
---boundary---
<<<<<<

The problem is that, for form data, multiple values for an attribute are supposed to just
be repeated form elements, e.g.:

>>>>>>
----boundary---
Content-Disposition: form-data; name=metadata_attribute_name
Content-Type: text; charset=utf-8

abc;def;ghi
---boundary---
Content-Disposition: form-data; name=metadata_attribute_name
Content-Type: text; charset=utf-8

second value
---boundary---

<<<<<<

What's happening, though, when this is posted to Solr is that any semicolons in the data are
being interpreted as multi-value separators.  So when the above is posted, Solr apparently
thinks that "metadata_attribute_name" has 4 values, "abc", "def", "ghi", and "second value",
rather than two values, "abc;def;ghi" and "second value".

Is this intended behavior, and if so, how am I supposed to escape ";" characters when communicating
to Solr in this way?

Karl



Mime
View raw message