Difference between revisions of "Team:William and Mary/Outreach DB/Fuzzy Search"

Line 147: Line 147:
 
             $(this).parent().find(".tag-type").toggle();
 
             $(this).parent().find(".tag-type").toggle();
 
           });
 
           });
 
+
          outreach_arr = alasql('select * from outreach')
 
           var options = {
 
           var options = {
 
             shouldSort: true,
 
             shouldSort: true,
Line 155: Line 155:
 
             maxPatternLength: 32,
 
             maxPatternLength: 32,
 
             minMatchCharLength: 1,
 
             minMatchCharLength: 1,
             keys: [
+
             keys: Object.keys(outreach_arr[0])
              "title",
+
              "author.firstName"
+
            ]
+
 
           };
 
           };
           fuse = new Fuse(alasql('select * from outreach'), options); // "list" is the item array
+
           fuse = new Fuse(outreach_arr, options); // "list" is the item array
          var result = fuse.search("aachen");
+
          console.log(result)
+
 
         }
 
         }
 
       );
 
       );
Line 199: Line 194:
 
     }
 
     }
  
 +
    function fulltext_search(str){
 +
      shor_results(search_result = fuse.search(str))
 +
    }
 
     function show_details(outreach_id) {
 
     function show_details(outreach_id) {
 
       datastring = encodeURIComponent(
 
       datastring = encodeURIComponent(

Revision as of 00:25, 2 November 2017

Outreach Database: select tags for search





Quick ID Jump: