new Search()
For searching against titles and keywords on the Symptom Checker API
Methods
-
<inner> getKeywords(titles, search)
-
For getting the keyword matches for a search tring from an array of titles
Parameters:
Name Type Description titlesArray.<Title> An array of titles to get keyword matches from
searchstring A search string.
Returns:
keywords matching the search string sorted by score decreasing
- Type
- Array.<string>
-
<inner> getTitles(_titles, search)
-
For getting titles that match a search string. Will break on spaces and score against titles and keywords.
Parameters:
Name Type Description _titlesArray.<Title> An array of titles to filter.
searchstring A search string.
Returns:
titles matching the search string sorted by score decreasing
- Type
- Array.<Title>
-
<inner> sortByScore(a, b)
-
Sort objects by their score property
Parameters:
Name Type Description aScorable A scorable object
bScorable A scorable object
Returns:
sorted objects by score decreasing
- Type
- compareFunction