You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Readme.md
+23-1
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,17 @@
2
2
3
3
reds is a light-weight Redis search for node.js. This module was originally developed to provide search capabilities for [Kue](http://automattic.github.io/kue/) a priority job queue, however it is very much a light general purpose search library that could be integrated into a blog, a documentation server, etc.
4
4
5
+
## Upgrading
6
+
7
+
Version 1.0.0 is syntactically compatible with previous versions of reds (0.2.5). However, [natural](https://github.com/NaturalNode/natural) has been updated. Documents indexed with older installs of reds (using natural v0.2.0) may need to be re-indexed to avoid some edge cases.
8
+
5
9
## Installation
6
10
7
11
$ npm install reds
8
12
9
13
## Example
10
14
11
-
The first thing you'll want to do is create a `Search` instance, which allows you to pass a `key`, used for namespacing within Redis so that you may have several searches in the same db.
15
+
The first thing you'll want to do is create a `Search` instance, which allows you to pass a `key`, used for namespacing within Redis so that you may have several searches in the same db. You may specify your own [node_redis](https://github.com/NodeRedis/node_redis) instance with the `reds.setClient` function.
Starting in 1.0.0, you can easily extend and expand how reds functions. When creating a new search, supply an object as the second argument. There are currently three properties that can be configured:
103
+
104
+
-`nlpProcess` the natural language processing function. You can alter how the words are processed (split, stemmed, and converted to metaphones) using this function.
105
+
-`writeIndex` how the items are written to the index.
106
+
-`removeIndex` how the items are removed from the index.
107
+
108
+
See the `lib/reds.js` file for the implementation of each. Please keep in mind that changing these functions may invalidate your previously stored index.
109
+
110
+
```js
111
+
reds.createSearch('pets', {
112
+
nlpProcess : yourNlpProcessingFunction,
113
+
writeIndex : yourWriteIndexFunction,
114
+
removeIndex : yourRemoveIndexFunction
115
+
});
116
+
```
117
+
96
118
## About
97
119
98
120
Currently reds strips stop words and applies the metaphone and porter stemmer algorithms to the remaining words before mapping the constants in Redis sets. For example the following text:
0 commit comments