Skip to content

Commit 8f4ca7a

Browse files
author
Clinton Gormley
committed
Added wildcard search to the last search term
1 parent 710e611 commit 8f4ca7a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

search.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,14 @@
9999
if ( searchRequest && searchRequest.readyState < 4 ) {
100100
searchRequest.abort();
101101
}
102+
var q = request.term;
103+
var re = /[^ *]/;
104+
if (re.test(q)) { q = q + '*' }
102105
searchRequest = $.ajax({
103106
url: [ elastic_search_url, $.param( {
104107
fields : "title,category,url",
105108
size : 25,
106-
q : request.term,
109+
q : q,
107110
default_operator: "AND"
108111
} )].join("?"),
109112
dataType: "jsonp",

0 commit comments

Comments
 (0)