Skip to content

Apache Lucene open-source search software

SOLR-3668: fix handling of custom parameters for dataimport on admin ui

Stefan Matheis7626f1cda27e
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e1bc583e539..57fc0429058 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -64,6 +64,8 @@ New Features
* SOLR-3597: seems like a lot of wasted whitespace at the top of the admin screens
(steffkes)
+* SOLR-3668: DataImport : Specifying Custom Parameters (steffkes)
+
Optimizations
----------------------
diff --git a/solr/webapp/web/js/scripts/dataimport.js b/solr/webapp/web/js/scripts/dataimport.js
index 9f1257f932f..c18f129df6e 100644
--- a/solr/webapp/web/js/scripts/dataimport.js
+++ b/solr/webapp/web/js/scripts/dataimport.js
@@ -531,7 +531,12 @@ sammy.get
var custom_parameters = $( '#custom_parameters', form ).val();
if( custom_parameters.length )
{
- array.push( { name : 'custom_parameters', value: custom_parameters } );
+ var params = custom_parameters.split( '&' );
+ for( var i in params )
+ {
+ var tmp = params[i].split( '=' );
+ array.push( { name : tmp[0], value: tmp[1] } );
+ }
}
},
success : function( response, text_status, xhr )
diff --git a/solr/webapp/web/tpl/dataimport.html b/solr/webapp/web/tpl/dataimport.html
index c6e7cd608c4..e009e26e3b4 100644
--- a/solr/webapp/web/tpl/dataimport.html
+++ b/solr/webapp/web/tpl/dataimport.html
@@ -112,7 +112,7 @@ limitations under the License.
<label for="custom_parameters">
<a rel="help">Custom Parameters</a>
</label>
- <input type="text" id="custom_parameters" value="">
+ <input type="text" id="custom_parameters" value="" placeholder="key1=val1&amp;key2=val2">
<button type="submit">Execute Import</button>