Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Last active August 29, 2015 14:10
Show Gist options
  • Save jcoyne/1243e34a89436c9f030a to your computer and use it in GitHub Desktop.
Save jcoyne/1243e34a89436c9f030a to your computer and use it in GitHub Desktop.
Potential Solr bug for `fl` parameter when there is a colin in the field name.
, [2014-12-01T11:31:42.417498 #3478] DEBUG -- : HTTP POST (5.29ms) http://localhost:8983/solr/test/update?wt=ruby
D, [2014-12-01T11:31:42.417644 #3478] DEBUG -- : Request body <?xml version="1.0" encoding="UTF-8"?><add><doc><field name="id">123</field><field name="foo:bar_ssi">Hmm</field></doc></add>
D, [2014-12-01T11:31:42.417719 #3478] DEBUG -- : Response status Net::HTTPOK (200)
D, [2014-12-01T11:31:42.417787 #3478] DEBUG -- : Response body {'responseHeader'=>{'status'=>0,'QTime'=>2}}
D, [2014-12-01T11:31:54.376250 #3478] DEBUG -- : HTTP POST (19.05ms) http://localhost:8983/solr/test/update?wt=ruby
D, [2014-12-01T11:31:54.376355 #3478] DEBUG -- : Request body <?xml version="1.0" encoding="UTF-8"?><commit/>
D, [2014-12-01T11:31:54.376416 #3478] DEBUG -- : Response status Net::HTTPOK (200)
D, [2014-12-01T11:31:54.376508 #3478] DEBUG -- : Response body {'responseHeader'=>{'status'=>0,'QTime'=>16}}
D, [2014-12-01T11:32:00.047052 #3478] DEBUG -- : HTTP GET (6.70ms) http://localhost:8983/solr/test/select?wt=ruby&q=id:123
D, [2014-12-01T11:32:00.047183 #3478] DEBUG -- : Response status Net::HTTPOK (200)
D, [2014-12-01T11:32:00.047270 #3478] DEBUG -- : Response body {'responseHeader'=>{'status'=>0,'QTime'=>3,'params'=>{'q'=>'id:123','wt'=>'ruby'}},'response'=>{'numFound'=>1,'start'=>0,'maxScore'=>3.3978953,'docs'=>[{'id'=>'123','foo:bar_ssi'=>'Hmm','timestamp'=>'2014-12-01T17:31:42.414Z','score'=>3.3978953}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'active_fedora_model_ssi'=>[],'object_type_si'=>[]},'facet_dates'=>{},'facet_ranges'=>{}}}
D, [2014-12-01T11:32:06.866966 #3478] DEBUG -- : HTTP GET (7.85ms) http://localhost:8983/solr/test/select?wt=ruby&q=id:123&fl=foo:bar_ssi
D, [2014-12-01T11:32:06.867096 #3478] DEBUG -- : Response status Net::HTTPOK (200)
D, [2014-12-01T11:32:06.867186 #3478] DEBUG -- : Response body {'responseHeader'=>{'status'=>0,'QTime'=>2,'params'=>{'fl'=>'foo:bar_ssi','q'=>'id:123','wt'=>'ruby'}},'response'=>{'numFound'=>1,'start'=>0,'docs'=>[{}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'active_fedora_model_ssi'=>[],'object_type_si'=>[]},'facet_dates'=>{},'facet_ranges'=>{}}}
@jcoyne
Copy link
Author

jcoyne commented Dec 1, 2014

It also returns an empty document when querying with: http://localhost:8983/solr/test/select?wt=ruby&q=id:123&fl=foo%3Abar_ssi

@jcoyne
Copy link
Author

jcoyne commented Dec 1, 2014

Trying to escape with a backslash (i.e. http://localhost:8983/solr/test/select?wt=ruby&q=id:123&fl=foo\%3Abar_ssi) yields:

{'responseHeader'=>{'status'=>400,'QTime'=>19,
    'params'=>{'fl'=>'foo\\:bar_ssi','q'=>'id:123','wt'=>'ruby'}},
    'error'=>{'msg'=>'undefined field: "foo"','code'=>400}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment