{"action":"created","issue":{"url":"https://api.github.com/repos/pittquantum/PittQuantumRepository/issues/75","labels_url":"https://api.github.com/repos/pittquantum/PittQuantumRepository/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/pittquantum/PittQuantumRepository/issues/75/comments","events_url":"https://api.github.com/repos/pittquantum/PittQuantumRepository/issues/75/events","html_url":"https://github.com/pittquantum/PittQuantumRepository/issues/75","id":110826404,"number":75,"title":"Autocomplete JSON File Suggestions ","user":{"login":"JoshuaRogan","id":8824977,"avatar_url":"https://avatars.githubusercontent.com/u/8824977?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshuaRogan","html_url":"https://github.com/JoshuaRogan","followers_url":"https://api.github.com/users/JoshuaRogan/followers","following_url":"https://api.github.com/users/JoshuaRogan/following{/other_user}","gists_url":"https://api.github.com/users/JoshuaRogan/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshuaRogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshuaRogan/subscriptions","organizations_url":"https://api.github.com/users/JoshuaRogan/orgs","repos_url":"https://api.github.com/users/JoshuaRogan/repos","events_url":"https://api.github.com/users/JoshuaRogan/events{/privacy}","received_events_url":"https://api.github.com/users/JoshuaRogan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pittquantum/PittQuantumRepository/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-11T00:52:16Z","updated_at":"2015-10-11T00:56:19Z","closed_at":null,"body":"So I have auto complete finished and works pretty well. You can search by any part of the name, and part of the formula (ex it will find CO2 by typing in C or O2). I'm just about to add synonyms but that is essentially the same as name so it won't be an issue. \r\n\r\nThe question I am looking for some feedback on is how I am building the auto complete dictionary. It is going to be a two step processes that doesn't involve querying the database.  I determined for about 450KB I can store 1000 molecules embedded in the html, I still can squeeze more out of that number I think but I don't want to add too much size to every page. These molecules should be the *most common* but I don't have an efficient way to determine that as of yet. After the initial page load, it will make a request to get more, maybe all to further improve the search. \r\n\r\nTL;DR Does anyone have an idea to determine what the most common molecules will be based on how we are storing our files? One idea is to start logging search and their results as well which will be able to optimize the auto-complete even further."},"comment":{"url":"https://api.github.com/repos/pittquantum/PittQuantumRepository/issues/comments/147142451","html_url":"https://github.com/pittquantum/PittQuantumRepository/issues/75#issuecomment-147142451","issue_url":"https://api.github.com/repos/pittquantum/PittQuantumRepository/issues/75","id":147142451,"user":{"login":"JoshuaRogan","id":8824977,"avatar_url":"https://avatars.githubusercontent.com/u/8824977?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshuaRogan","html_url":"https://github.com/JoshuaRogan","followers_url":"https://api.github.com/users/JoshuaRogan/followers","following_url":"https://api.github.com/users/JoshuaRogan/following{/other_user}","gists_url":"https://api.github.com/users/JoshuaRogan/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshuaRogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshuaRogan/subscriptions","organizations_url":"https://api.github.com/users/JoshuaRogan/orgs","repos_url":"https://api.github.com/users/JoshuaRogan/repos","events_url":"https://api.github.com/users/JoshuaRogan/events{/privacy}","received_events_url":"https://api.github.com/users/JoshuaRogan/received_events","type":"User","site_admin":false},"created_at":"2015-10-11T00:56:19Z","updated_at":"2015-10-11T00:56:19Z","body":"Everything is in a Trie in JavaScript. I am using a suggestion engine called Bloodhound( https://github.com/twitter/typeahead.js/blob/master/doc/bloodhound.md). It's very powerful and lightweight. The issue is just getting all of the data to the client. I don't want to query back and forth to the server as that is very slow for something like auto complete where you need results instantly. "}}