Code Monkey home page Code Monkey logo

jsindexer's Introduction

jsindexer

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 cloudant.com. This is an alternative to the Java/Lucene indexers used by default.

Requirements

cloudant hosted account (sign up at https://cloudant.com/#!/solutions/cloud), couchapp

Install

cd jsindexer
cat > .couchapprc
{"env":{"default":{"db":"http://<user>:<pass>@<user>.cloudant.com:5984/<db_or_couchapp_you_want_to_search>"}}}
^C

that last line means hit CTRL-C

To configure the indexing of documents, modify the file:

views/whitespace/map.js

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

emit([field,token],[[1,6,8]]);

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

couchapp push

Now trigger indexing with:

http://<user>.cloudant.com:5984/<db_or_couchapp_you_want_to_search>/_design/jsindexer/_view/whitespace

Once indexing is done, you can use the regular search syntax (http://support.cloudant.com/kb/search/search-api), but yon need to specify the index:

http://<user>.cloudant.com:5984/<db_or_couchapp_you_want_to_search>/_search?q=myfield:"some phrase"&index=_design/jsindexer/_view/whitespace

jsindexer's People

Contributors

hardtke avatar

Stargazers

ZongqiangZhang avatar JT5D avatar Nathan Vander Wilt avatar Michael Gradek avatar Lee avatar Himanshu Gilani avatar Bernhard Gschwantner avatar Geert avatar  avatar Alex Schedler avatar Gabriel de Oliveira Barbosa avatar Johan Sellström avatar  avatar Nicolas Thouvenin avatar Fabien Franzen avatar

Watchers

Russell Branca avatar Paul J. Davis avatar Mike Miller avatar Jay Doane avatar Eric Avdey avatar Will Holley avatar Alan Hoffman avatar Benjamin Anderson avatar Garren avatar Pen Gale avatar Henning Diedrich avatar PÁLI Gábor János avatar Dan DeMichele avatar Ben Keen avatar Mike Elsmore avatar Cleto Martín avatar James Cloos avatar David Tyler avatar Sean Hudgston avatar Andy Ellicott avatar Joshua McBride avatar Kyle Snavely avatar Rhys Short avatar Derek Schoettle avatar Paul Szczypka avatar Anthony Abdulla avatar Chris Glew avatar Stefan Kruger avatar Yang Lei avatar Kevin Wolf avatar John Harrison avatar  avatar Dan Cheeseman avatar chinajuanbob avatar David Taieb avatar Eric Appelt avatar Jake Epstein avatar Srdjan Jendruh avatar Michael Breslin avatar  avatar Emil Czajka avatar Ryan Millay avatar Aaron Nelson avatar Asim Singh avatar Tony Sun avatar Rob Silvagni avatar Riccardo Brognara avatar Christopher J Quinones avatar Justin Campbell avatar  avatar Dwight Ford avatar Sean Conway avatar Kent Kjaer avatar Robert Mckenzie avatar Wayne Deleo avatar Joe Cavanaugh avatar Aruna Kolluru avatar Vincent Ong avatar Vincent Kelly avatar Adrian Warman avatar Bessenyei Balázs Donát avatar Marc Suesser avatar Becky Wright avatar  avatar  avatar nierui avatar Esteban Laver avatar Rohit Agarwal avatar Andrew-Rombach avatar Paul Tinagbedia avatar  avatar Todd Shulman avatar Ben Perlmutter avatar TS avatar Darek Czapinski avatar Brian Wilkins avatar  avatar Yali Wang avatar Scott Davidson avatar Lakshmi Palaniappan avatar Jozef de Vries avatar David J Schlegel avatar Dr Doug Cowie avatar HUI ZHAO avatar  avatar  avatar Yusuf Khan avatar liujjcdl avatar Keerthi Sukumaran avatar Paul Nightingale avatar  avatar SEF MUTARI avatar Sajish Rama krishnan avatar Graham Thackrah avatar Mercy Ilade avatar coughlan@uk.ibm.com avatar Ram Maganti avatar Kristin Keating avatar Harshdeep  avatar Chun Hui Wang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.