{"id":16889745,"url":"https://github.com/benoitc/hypercouch","last_synced_at":"2025-06-20T09:05:30.932Z","repository":{"id":487827,"uuid":"113922","full_name":"benoitc/hypercouch","owner":"benoitc","description":"Full text indexing of CouchDB via HyperEstraier","archived":false,"fork":false,"pushed_at":"2009-01-24T23:45:02.000Z","size":100,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-20T00:18:50.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://github.com/davisp/hypercouch","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benoitc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-01-24T18:27:38.000Z","updated_at":"2020-01-21T11:12:46.000Z","dependencies_parsed_at":"2022-07-20T15:17:50.594Z","dependency_job_id":null,"html_url":"https://github.com/benoitc/hypercouch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/benoitc/hypercouch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fhypercouch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fhypercouch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fhypercouch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fhypercouch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitc","download_url":"https://codeload.github.com/benoitc/hypercouch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fhypercouch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260915858,"owners_count":23082036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T16:58:42.689Z","updated_at":"2025-06-20T09:05:25.917Z","avatar_url":"https://github.com/benoitc.png","language":"Python","readme":"HyperCouch\n==========\n\nFull text indexing for [CouchDB][couchdb]. (I really mean it this time.)\n\nRequriements\n------------\n\nThere are a couple dependancies that should hopefully be easy to overcome. I have things working on OS X 10.4 so Linux should be a breeze. Windows installation is left as an exercise to the reader.\n\n\n1. [CouchDB][couchdb] - Obviously\n1. [HyperEstraier][hyper] - Full text indexing goodness\n1. [Spidermonkey][spider] - Requirement of CouchDB as well **Might require Spidermonkey 1.7**\n1. [hypy][hypy] - Python bindings to HyperEstraier\n1. [python-spidermonkey][pyspider] - **My version on github**\n1. [hypercouch][hypercouch] - This project?\n\nOpenBSD: \n    $ pkg_add -iv py-simplejson\n    $ pkg_add -iv py-httplib2\n    $ pkg_add -iv py-nose\n\nOS X python modules:\n\n    $ sudo port install py25-simplejson\n    $ sudo port install py25-httplib2\n    $ sudo port install py25-nose\n    \nUbuntu:\n\n    $ sudo apt-get install simplejson\n    $ sudo apt-get isntall httplib2\n    $ sudo apt-get install python-nose\n\nAnd couchdb-python:\n\n    $ svn checkout http://couchdb-python.googlecode.com/svn/trunk/ couchdb-python\n    $ cd couchdb-python\n    $ sudo python setup.py install\n\nFor the moment I haven't performed this installation on Linux. Tomorrow I'll sit down and install on one of my severs but for now I'll just go over the OS X procedure and hope the Linux equivalent isn't too far off.\n\nInstallation\n------------\n\nI won't go over installing CouchDB because it's pretty well covered on the [wiki][wiki]. If you need help with it check there or hop onto the IRC channel (#couchdb on irc.freenode.net) and ask questions.\n\nLinux People\n------------\n\nMake sure you have the python dev stuff installed for building extensions:\n\n    $ sudo apt-get install python2.5-dev\n\nHyperEstraier\n-------------\n\nHyperEstraier should probably be in your package manager. On OS X it's merely:\n\n    $ sudo port install libestraier-dev libqdbm-dev\n\nUbuntu:\n\n    $ sudo apt-get install libestraier-dev\n\nOpenbsd:\n\nInstall Hyperestraier from sources:\n    \n    $ pkg_add -iv qdbm\n    $ ftp http://hyperestraier.sourceforge.net/hyperestraier-1.4.13.tar.gz\n    $ tar xvzf hyperestraier-1.4.13.tar.gz\n    $ cd hyperestraier-1.4.13\n    $ ./configure \u0026\u0026 gmake \u0026\u0026 gmake install\n\n\nSpidermonkey\n------------\n\nSpidermonkey is similar\n\n    $ sudo port install spidermonkey\n\nUbuntu:\n\n    $ sudo apt-get install libmozjs-dev\n\nOpenBSD:\n    \n    $ pkg_add -iv spidermonkey\n\nActivation Errors\n-----------------\n\nIf either of your port commands fails due to activation conflicts, you can just deactivate and then rerun the install to get things right:\n\n    $ sudo port deactivate [package]\n    $ sudo port install [package]\n\nHopefully that was the hard part. The rest of the stuff is just about getting the python bindings installed.\n\nHyPy\n----\n\nGet the source here: [http://hypy-source.goonmill.org/archive/tip.tar.gz][hypy-download]\n\nFor me hypy was easy to install with the caveat that I had to make a minor tweak to `setup.py` to help it find HyperEstraier installed by `ports`. We just need to add `/opt/local/include` to the list of include directories:\n\nFrom: (About line 10 in Hypy's setup.py)\n\n    ext = Extension(\"_estraiernative\",\n                    [\"estraiernative.c\"],\n                    libraries=[\"estraier\"],\n                    include_dirs=[\"/usr/include/estraier\", \"/usr/include/qdbm\"],\n                    )\n\nTo:\n\n    ext = Extension(\"_estraiernative\",\n                    [\"estraiernative.c\"],\n                    libraries=[\"estraier\"],\n                    library_dirs=[\"/usr/local/lib\", \"/usr/lib\"],\n                    include_dirs=[\"/usr/local/include\", \"/usr/include/estraier\", \"/usr/include/qdbm\", \"/opt/local/include/\"],\n                    )\n\nHopefully that builds just dandy for you.\n\npython-spidermonkey\n-------------------\n\nI actually had to download and patch this project to allow the execution of JavaScript functions from Python. I'm very unsure of the build stability but hopefully it works without too much effort. For the time being you can either `git clone` it or download the tarball to install. At some point in the near future I'm going to give it a more thorough re-working to make it a real project.\n\nUsing git:\n\n    $ git clone git://github.com/davisp/python-spidermonkey.git \n    $ cd python-spidermonkey\n\nNo git:\n\n    $ wget http://github.com/davisp/python-spidermonkey/tarball/master\n    $ tar -xvzf davisp-python-spidermonkey-${HASH}.tar.gz\n    $ cd davisp-python-spidermonkey-${HASH}\n    \nInstalling:\n\n    $ python setup.py build\n    $ sudo python setup.py isntall\n\nHyperCouch\n----------\n\nInstalling HyperCouch should be relatively straight forward. Just `git clone` or download the tarball and install.\n\nUsing git:\n\n    $ git clone git://github.com/davisp/hypercouch.git\n    $ cd hypercouch\n\nNo git:\n\n    $ wget http://github.com/davisp/hypercouch/tarball/master\n    $ tar -xvzf davisp-hypercouch-${HASH}.tar.gz\n    $ cd davisp-hypercouch-${HASH}\n\nInstalling:\n\n    $ sudo python setup.py install\n\nConfiguring CouchDB\n-------------------\n\nYou'll need to edit your `local.ini` or alternatively your `local_dev.ini` if you're a fan of `make dev` like I am.\n\n    [external]\n    hyper = /path/to/python -m hypercouch\n\n    [httpd_db_handlers]\n    _fti = {couch_httpd_external, handle_external_req, \u003c\u003c\"hyper\"\u003e\u003e}\n\nAlternatively, in your `[external]` section you can use `/path/to/hypercouch/dev.sh` without installing to make dev work easier for when you start submitting bug reports and patches. (This avoids the constant `sudo python setup.py install` running when you change `hypercouch` sources.)\n\nUsing HyperCouch\n----------------\n\nTo use `hypercouch` all you need to do is add a JavaScript function to your `_design/doc`'s in the `ft_index` member. This function has two special JavaScript functions you can call to add indexing info for your document.\n\n1. `index(data)` - adds `data` to the full text index\n1. `property(name, value)` - adds properties to the document for use in sorting and limiting results\n\n\nExample `_design/document`:\n\n    {\n        \"_id\": \"_design/foo\",\n        \"_rev\": \"32498230012\",\n        \"ft_index\": \"function(doc) {if(doc.body) index(doc.body); if(doc.foo) property(\"foo\", doc.foo);}\"\n    }\n\nExample URL's:\n\n    $ curl http://127.0.0.1:5984/db_name/_fti?q=term1+term2\n    $ curl http://127.0.0.1:5984/db_name/_fti?q=term1+AND+term2\n\nCaveat:\n\nIt may take a few seconds before the indexed results become available. There's no guarantee that a document has been indexed as soon as you commit it to the database.\n\nSupports\n--------\n\n1. `q` - Requests with arbitrary AND/OR type of boolean logic.\n1. `limit` and `skip` parameters - For paging type stuff (Beware when not using a specified sort)\n1. `matching` - Specify a HyperEstraier parsing method\n1. `order` - Order results by an arbitrary propert. Syntax: `prop_name [STRA|STRD|NUMA|NUMD]`\n1. `highlight` - Retrieve a highlighted snipped. Currently only supports an html format via `highlight=html`\n1. Other attribute limiting via `attr_name=METHOD param` See [Search Conditions][hypersearching] for specifics.\n\n[couchdb]:http://couchdb.apache.org \"CouchDB\"\n[hyper]:http://hyperestraier.sourceforge.net/ \"Hyper Estraier\"\n[spider]:http://www.mozilla.org/js/spidermonkey/ \"Spidermonkey\"\n[hypy]:http://www.goonmill.org/hypy/ \"Hypy\"\n[hypy-download]:http://hypy-source.goonmill.org/archive/tip.tar.gz \"Download Hypy\"\n[pyspider]:http://github.com/davisp/python-spidermonkey/tree/master \"Python Spidermonkey\"\n[hypercouch]:http://github.com/davisp/python-spidermonkey/tree/master \"HyperCouch\"\n[hypersearching]:http://hyperestraier.sourceforge.net/uguide-en.html#searchcond \"Hyper Estraier Searching\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fhypercouch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitc%2Fhypercouch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fhypercouch/lists"}