mashery/iodocs — pull request #120 by vkorapaty (2013-09-13 15:45:04+00:00)
Title: Implemented api search feature.

Type-ahead feature requires at least 2 characters before results are
returned. When a given search term is submitted, all endpoints and
methods that are not part of the result set are hidden. Clearing the
search will return the page to its normal state.

Implementation details:
* If ' OR ' is present in the search string, the search term will be split
on ' OR ', and the first two parts will be used. These two parts will have spaces
stripped from them and then the regex term will present results that
contain matches that have either term. Ex - search term: 'google OR twitter
instagram' would search for any method that contains 'google' or 'twitter', but
not 'twitter instagram' or 'instagram'.
* If ' OR ' is not present, the given term will be searched for, spaces will
not be removed from the given term in this case.
* Space between words are considered as an implicit AND which helps
narrow down search results. Order for the words/terms does not matter as
long they all appear in a particular field. (Name, type, description,
synopsis, etc.)
* Search results are limited. When more than 20 methods are matched, only
the endpoints are shown. The endpoints can be clicked on to show the
matched methods.
* When type-ahead result methods are clicked on, their respective full
versions are expanded.
* Methods in search results have a background color depending on their
HTTPMethod type, making them more visually distinct.
* Clear search results after pressing enter with an empty search field.