You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue from code4lib discussions. The idea is that the search UI can look at the hash so that https://minicomp.github.io/wax/search/#Qatar opens up a search directly to items matching the string "#Qatar".
Happy to have this assigned to me if it's desirable.
One question is whether entering a search should also update the hash dynamically as well.
functionstartSearchUI(fields,indexFile,url){$.getJSON(indexFile,function(store){varindex=newelasticlunr.Index;index.saveDocument(false);index.setRef('lunr_id');for(iinfields){index.addField(fields[i]);}for(iinstore){index.addDoc(store[i]);}functionrun_search(terms){varresults_div=$('#results');varquery=termsvarresults=index.search(query,{boolean: 'AND',expand: true});results_div.empty();results_div.append(`<p class="results-info">Displaying ${results.length} results</p>`);for(varrinresults){varref=results[r].ref;varitem=store[ref];varresult=displayResult(item,fields,url);results_div.append(result);}}if(window.location.hash){varsearch=decodeURIComponent(window.location.hash.slice(1);$('input#search').val(search)// Is this how you assign in jquery?run_search(search)}$('input#search').on('keyup',function(){varquery=$(this).val();run_search(query)}});});}
The text was updated successfully, but these errors were encountered:
Issue from code4lib discussions. The idea is that the search UI can look at the hash so that
https://minicomp.github.io/wax/search/#Qatar
opens up a search directly to items matching the string "#Qatar".Happy to have this assigned to me if it's desirable.
One question is whether entering a search should also update the hash dynamically as well.
The text was updated successfully, but these errors were encountered: