diff --git a/TODO b/TODO
new file mode 100644
index 0000000..c51c2c1
--- /dev/null
+++ b/TODO
@@ -0,0 +1,16 @@
+Coming soon
+===========
+Better README
+Clearer function comments
+
+
+Maybe one day
+=============
+Larger/More extensive set of test data
+Wildcard support
+Stemming
+
+
+Probably not
+============
+Ranged queries
diff --git a/test.html b/test.html
index f8bd8d5..ac49f98 100644
--- a/test.html
+++ b/test.html
@@ -7,10 +7,27 @@
-
-
-
-
+
+
+
+
@@ -55,38 +72,52 @@
output.val(output.val() + 'indexed in ' + (new Date().getTime() - s) + "ms\n");
});
- // Setup the search button
- $('#btn_search').click(function(){
- output.val(output.val() + 'Searching .. ');
-
- var s = new Date().getTime();
- var results = t.search($('#search').val());
- output.val(output.val() + 'completed in ' + (new Date().getTime() - s) + "ms\n");
+ // Setup the search buttons
+ $('#btn_or_search').click(function(){
+ dosearch(false, $('#or_search').val());
+ });
- var rtbl = $('#result_table').empty();
- for(var idx in results){
- var i = results[idx];
-
- rtbl.append(
- '
' +
- '' + json[i]['id'] + ' | ' +
- '' + json[i]['name'] + ' | ' +
- '' + json[i]['email'] + ' | ' +
- '' + json[i]['city'] + ' | ' +
- '' + json[i]['state'] + ' | ' +
- '' + json[i]['country'] + ' | ' +
- '' + json[i]['rank'] + ' | ' +
- '' + json[i]['desc'] + ' | ' +
- '
'
- );
- }
+ $('#btn_and_search').click(function(){
+ dosearch(true, $('#and_search').val());
});
// Enter should work to search, too
- $('#search').keydown(function(e){
- if(e.which == 13){ $('#btn_search').click(); }
+ $('#or_search').keydown(function(e){
+ if(e.which == 13){ $('#btn_or_search').click(); }
+ });
+
+ $('#and_search').keydown(function(e){
+ if(e.which == 13){ $('#btn_and_search').click(); }
}).focus();
});
+
+
+ function dosearch(and_search, value){
+ var output = $('#output');
+ output.val(output.val() + 'Searching .. ');
+
+ var s = new Date().getTime();
+ var results = t.search(and_search, value);
+ output.val(output.val() + 'completed in ' + (new Date().getTime() - s) + "ms\n");
+
+ var rtbl = $('#result_table').empty();
+ for(var idx in results){
+ var i = results[idx];
+
+ rtbl.append(
+ '' +
+ '' + json[i]['id'] + ' | ' +
+ '' + json[i]['name'] + ' | ' +
+ '' + json[i]['email'] + ' | ' +
+ '' + json[i]['city'] + ' | ' +
+ '' + json[i]['state'] + ' | ' +
+ '' + json[i]['country'] + ' | ' +
+ '' + json[i]['rank'] + ' | ' +
+ '' + json[i]['desc'] + ' | ' +
+ '
'
+ );
+ }
+ }