js-search
Version:
JS Search is an efficient, client-side search library for JavaScript and JSON objects
19 lines (16 loc) • 628 B
JavaScript
// @flow
/**
* Indexing is the most important part of search. A proper index allows query terms to be matched to related results in
* an efficient manner.
*
* <p>The simplest index strategy is to only index on a token. Other strategies can often be more useful though. For
* example a prefix indexing strategy (e.g. "cat" to "c", "ca", "cat") allows users to search as they type, gradually
* refining results as the search query becomes more detailed.
*/
export interface IIndexStrategy {
/**
* @param token A search token
* @return Expanded search token
*/
expandToken(token : string) : Array<string>;
};