Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-4309: /browse: Improve JQuery autosuggest behavior

Jan Høydahle40f5acf04a2
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 17435ba5ca0..b916a12fc60 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -60,7 +60,20 @@ Upgrading from Solr 4.1.0
Detailed Change List
----------------------
-(No changes yet)
+New Features
+----------------------
+
+Bug Fixes
+----------------------
+
+* SOLR-4309: /browse: Improve JQuery autosuggest behavior (janhoy)
+
+Optimizations
+----------------------
+
+Other Changes
+----------------------
+
================== 4.1.0 ==================
diff --git a/solr/example/solr/collection1/conf/velocity/head.vm b/solr/example/solr/collection1/conf/velocity/head.vm
index 265b7d3f3d5..0a436c7fd2c 100644
--- a/solr/example/solr/collection1/conf/velocity/head.vm
+++ b/solr/example/solr/collection1/conf/velocity/head.vm
@@ -20,7 +20,11 @@
'v.template': 'suggest'
}
}
- );
+ ).keydown(function(e){
+ if (e.keyCode === 13){
+ $("#query-form").trigger('submit');
+ }
+ });
// http://localhost:8983/solr/terms?terms.fl=name&terms.prefix=i&terms.sort=count
});
diff --git a/solr/example/solr/collection1/conf/velocity/jquery.autocomplete.js b/solr/example/solr/collection1/conf/velocity/jquery.autocomplete.js
index f1b2642e70e..09bb37616c7 100644
--- a/solr/example/solr/collection1/conf/velocity/jquery.autocomplete.js
+++ b/solr/example/solr/collection1/conf/velocity/jquery.autocomplete.js
@@ -325,6 +325,7 @@ $.Autocompleter = function(input, options) {
if (!options.matchCase)
term = term.toLowerCase();
var data = cache.load(term);
+ data = null; // Avoid buggy cache and go to Solr every time
// recieve the cached data
if (data && data.length) {
success(term, data);
@@ -398,7 +399,7 @@ $.Autocompleter.defaults = {
max: 100,
mustMatch: false,
extraParams: {},
- selectFirst: true,
+ selectFirst: false,
formatItem: function(row) { return row[0]; },
formatMatch: null,
autoFill: false,