<commit_before># Node suggestive search
A node module to help type-ahead and dropdown search boxes and also correct misspelled searches (did you mean?).


This module is compatible with:
- NeDB 1.8.0, The JavaScript Database from Louis Chatriot https://github.com/louischatriot/nedb
- MongoDB Node.JS Driver 2.2.19, Driver to connect with MongoDB 3.2 http://mongodb.github.io/node-mongodb-native/


## Installation, tests
Module name on npm is "node-suggestive-search".

```
npm install node-suggestive-search --save   # Put latest version in your package.json
```


## Example of usage
https://ivanvaladares.herokuapp.com

## Playground on Runkit
https://runkit.com/ivanvaladares/node-suggestive-search


## API
* <a href="#Setting-options">Setting options</a>
* <a href="#loading-a-database">Loading a database</a>
* <a href="#searching-for-items">Searching for items</a>
* <a href="#getting-words-suggestions">Getting words suggestions</a>
* <a href="#getting-items-suggestions">Getting items suggestions</a>
* <a href="#insert-items">Insert items</a>
* <a href="#remove-items">Remove items</a>


### Setting options
This module supports MongoDB and NeDB. You must set this options in order to use this module. 

Here is an example of a configuration wihtout a database (in-memory):
```javascript
var nss = require('node-suggestive-search').init();


Here is an example of a configuration to use MongoDB: 
```javascript
var nss = require('node-suggestive-search').init(
			{<commit_msg>Small correction<commit_after># Node suggestive search
A node module to help type-ahead and dropdown search boxes and also correct misspelled searches (did you mean?).


This module is compatible with:
- NeDB 1.8.0, The JavaScript Database from Louis Chatriot https://github.com/louischatriot/nedb
- MongoDB Node.JS Driver 2.2.19, Driver to connect with MongoDB 3.2 http://mongodb.github.io/node-mongodb-native/


## Installation, tests
Module name on npm is "node-suggestive-search".

```
npm install node-suggestive-search --save   # Put latest version in your package.json
```


## Example of usage
https://ivanvaladares.herokuapp.com

## Playground on Runkit
https://runkit.com/ivanvaladares/node-suggestive-search-1.8.0


## API
* <a href="#Setting-options">Setting options</a>
* <a href="#loading-a-database">Loading a database</a>
* <a href="#searching-for-items">Searching for items</a>
* <a href="#getting-words-suggestions">Getting words suggestions</a>
* <a href="#getting-items-suggestions">Getting items suggestions</a>
* <a href="#insert-items">Insert items</a>
* <a href="#remove-items">Remove items</a>


### Setting options
This module supports MongoDB and NeDB. You must set this options in order to use this module. 

Here is an example of a configuration wihtout a database (in-memory):
```javascript
var nss = require('node-suggestive-search').init();

```

Here is an example of a configuration to use MongoDB: 
```javascript
var nss = require('node-suggestive-search').init(
			{
{'fraction_non_alphanumeric': 0.13039117352056168, 'fraction_numerical': 0.007021063189568706, 'mean_word_length': 4.753846153846154, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6284225', 'n_tokens_mistral': 971, 'n_tokens_neox': 884, 'n_words': 295}