como la mayoría de los posts son recordatorios para cuando lo tenga que hacer de nuevo y me haya olvidado y por si a alguien le sirve :D
principalmente seguí estas dos guías
http://github.com/rnewson/couchdb-lucene
http://wiki.fluidproject.org/pages/viewpage.action?pageId=6823331
pero siempre la generalidad termina dejando algunas cosas flotando que hacen que uno pelee (hasta que mira "watch tail /usr/local/var/log/couchdb/couch.log")
supongo que tienen instalado y andando couchdb 0.10.0 (va a ser el caso si usan ubuntu karmic :)
lo primero que hacemos es bajar la versión estable de couchdb-lucene (actualmente la 0.4)
wget http://cloud.github.com/downloads/rnewson/couchdb-lucene/couchdb-lucene-0.4-jar-with-dependencies.jar.gz
unpack200 couchdb-lucene-0.4-jar-with-dependencies.jar.gz couchdb-lucene-0.4-jar-with-dependencies.jar
sudo mkdir /usr/local/var/lib/lucene
sudo cp couchdb-lucene-0.4-jar-with-dependencies.jar /usr/local/var/lib/lucene
chown -R couchdb:couchdb /usr/local/var/lib/lucene
chmod -R 0770 /usr/local/var/lib/lucene
sudo vim /usr/local/etc/couchdb/local.ini
; CouchDB Configuration Settings
; Custom settings should be made in this file. They will override settings
; in default.ini, but unlike changes made to default.ini, this file won't be
; overwritten on server upgrade.
[couchdb]
;max_document_size = 4294967296 ; bytes
[httpd]
;port = 5984
;bind_address = 127.0.0.1
[log]
;level = debug
[couch_httpd_auth]
;secret = replace this with a real secret
[external]
fti=/usr/bin/java -Dcouchdb.lucene.dir=/usr/local/var/lib/lucene -jar /usr/local/var/lib/lucene/couchdb-lucene-0.4-jar-with-dependencies.jar -search
[update_notification]
indexer=/usr/bin/java -Dcouchdb.lucene.dir=/usr/local/var/lib/lucene -jar /usr/local/var/lib/lucene/couchdb-lucene-0.4-jar-with-dependencies.jar -index
[couchdb]
os_process_timeout=60000 ; increase the timeout to 60 seconds.
[httpd_db_handlers]
_fti = {couch_httpd_external, handle_external_req, >}
; To create an admin account uncomment the '[admins]' section below and add a
; line in the format 'username = password'. When you next start CouchDB, it
; will change the password to a hash (so that your passwords don't linger
; around in plain-text files). You can add more admin accounts with more
; 'username = password' lines. Don't forget to restart CouchDB after
; changing this.
[admins]
marianoguerra = mysecretpassword
;admin = mysecretpassword
sudo -i -u couchdb couchdb -b
firefox http://localhost:5984/_utils/
{
"_id": "_design/search-docs",
"fulltext": {
"by_title": {
"index": "function(doc) { var ret=new Document(); ret.add(doc.title); return ret }"
},
"by_content": {
"index": "function(doc) { var ret=new Document(); ret.add(doc.body); return ret }"
}
}
}
curl http://localhost:5984/fresita/_fti/search-docs/by_title?q=ficticio
{"q":"default:ficticio","etag":"1244bf34b28","view_sig":"7368cf7d6f68ec4c60f40c52303de534","skip":0,"limit":25,"total_rows":1,"search_duration":14,"fetch_duration":0,"rows":[{"id":"9ed8514725e1dca56c57471286f5f389","score":2.556901454925537}]}