Skip to content

Apache Lucene open-source search software

SOLR-3325: linking to query UI with parameters will execute them

Ryan McKinley09df31df4231
diff --git a/solr/webapp/web/js/scripts/query.js b/solr/webapp/web/js/scripts/query.js
index 3f0afbc65e2..e0768c454a0 100644
--- a/solr/webapp/web/js/scripts/query.js
+++ b/solr/webapp/web/js/scripts/query.js
@@ -95,16 +95,7 @@ sammy.get
? fieldset.addClass( 'expanded' )
: fieldset.removeClass( 'expanded' );
}
- )
-
- for( var key in context.params )
- {
- if( 'string' === typeof context.params[key] )
- {
- $( '[name="' + key + '"]', query_form )
- .val( context.params[key] );
- }
- }
+ );
query_form
.die( 'submit' )
@@ -149,6 +140,23 @@ sammy.get
return false;
}
);
+
+ var fields = 0;
+ for( var key in context.params )
+ {
+ if( 'string' === typeof context.params[key] )
+ {
+ fields++;
+ $( '[name="' + key + '"]', query_form )
+ .val( context.params[key] );
+ }
+ }
+
+ if( 0 !== fields )
+ {
+ query_form
+ .trigger( 'submit' );
+ }
}
);
}