Skip to content
An example CouchApp based CouchDB javascript view that creates and inverted index using CouchDB map-reduce
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


jsindexer is an example javascript view that creates an inverted index needed to do full text search on a CouchApp or CouchDB database hosted on This is an alternative to the Java/Lucene indexers used by default.


cloudant hosted account (sign up at!/solutions/cloud), couchapp


cd jsindexer
cat > .couchapprc

that last line means hit *CTRL-C***

To configure the indexing of documents, modify the file:


Cloudant search expects key,value pairs with the following format:


where 1,6,8 are the positions of that token in the field. The positions enable phrase searches.

couchapp push

Now trigger indexing with:


Once indexing is done, you can use the regular search syntax (, but yon need to specify the index:

http://<user><db_or_couchapp_you_want_to_search>/_search?q=myfield:"some phrase"&index=_design/jsindexer/_view/whitespace
Something went wrong with that request. Please try again.