Twitter typeahead.js and a json object for multiple matches
<p>I'm writing a program that should be able to find a university course based on a few of the courses parameters. I have a huge json object containing 1360 objects, and each object has around 20-30 parameters. I am only interested in about 3-5 of them however.</p>

<p>What I want to do is to be able to find a course based on it's number, the name, the name of the teacher or a set of keywords that each course has in it's description. </p>

<p>Anyway. I have tried messing around with twitters typeahead.js and as far as I can understand you need to parse it an array of strings, and it only takes 1 array as far as it seems. Isn't there an easy way (or another javascript module) that I can do this?</p>

<p>My current object is:</p>

<pre><code>var courses = [
    { "number": "&lt;5 digits&gt;", 
      "name": "&lt;course name&gt;", 
      "teacher": "&lt;teacher name&gt;", 
      "keywords": "&lt;string of keywords&gt;" }
    { ... }
    { ... }
    { ... }
    and so forth..
 ];
</code></pre>

<p>And it is as mentioned 1360 objects of size.</p>

<p>I want to get an output similar to this:</p>

<p><a href="https://i.stack.imgur.com/nzxw0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nzxw0.png" alt="enter image description here"></a></p>

<p>However I want to be able to search on the parameters mentioned (number, name, teacher name, keywords) and get the best possible match for whatever was input into the text field.</p>

<p>Does anyone have an idea of how to achieve this?</p>