Class: Search

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
titles Array.<Title>

An array of titles to get keyword matches from

search string

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
_titles Array.<Title>

An array of titles to filter.

search string

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
a Scorable

A scorable object

b Scorable

A scorable object

Returns:

sorted objects by score decreasing

Type
compareFunction