couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Gable <zi...@ignition-project.com>
Subject Re: Help using couchdb-lucene 0.6.0
Date Sun, 10 Jul 2011 08:23:14 GMT
Right - one is read by CouchDB and one is read by CouchDB Lucene.

I encourage you to read the readme on the CouchDB Lucene GitHub page. It
tells you about all of the little gotchas like this.
On Jul 10, 2011 3:15 AM, "Doron Rotem" <doronrotem@gmail.com> wrote:
> OK, it works!
> Thanks very much.
>
> Turns out there are two couchdb-lucene.ini files:
> /usr/local/Cellar/couchdb-lucene/0.6.0/conf/couchdb-lucene.ini (this one
> includes local.url; here i need to use port 5986 because my couch uses
this
> port)
> /usr/local/etc/couchdb/local.d/couchdb-lucene.ini (this is the one i
> changed, and it didn't worked)
>
> the locate cmd on my machine didn't find the first file so i was sure
there
> is only one file.
>
> thanks again.
> Doron
>
> On Sun, Jul 10, 2011 at 10:56 AM, Keith Gable <ziggy@ignition-project.com
>wrote:
>
>> These are two separate config files IIRC. In one, you're telling the
>> CouchDB
>> side how to talk to C-L, and in the other you're telling C-L where
CouchDB
>> is. IIRC, the C-L config file is in a folder in the same level as the
"bin"
>> folder in C-L (so where you'd do bin/run, there's like a config/something
I
>> think).
>>
>> On Sun, Jul 10, 2011 at 2:16 AM, Doron Rotem <doronrotem@gmail.com>
wrote:
>>
>> > So I changed the os_process_timeout to be 1 instead of 60000 in
>> > couchdb-lucene.ini and when querying the view I got the "OS process
timed
>> > out" error, which means the config file does have some effect.
>> >
>> > But changing the local.url to http://0.0.0.0:5986 didn't have any
>> effect,
>> > it
>> > was still complaining "Connection to http://localhost:5984 refused".
>> >
>> > thanks for the tip.
>> > doron
>> >
>> >
>> >
>> > On Sun, Jul 10, 2011 at 4:19 AM, Keith Gable <
ziggy@ignition-project.com
>> > >wrote:
>> >
>> > > It sounds like your config file isn't getting read by CouchDB-Lucene
>> and
>> > > it's going with defaults. Maybe the config file isn't readable by the
>> > right
>> > > user, or maybe it's not in the right place. See if changing the
server
>> > > address to something that will cause an OS error (such as 0.0.0.0:0)
>> > still
>> > > tries to connect to 127.0.0.1:5984. You should get some sort of error
>> > that
>> > > it can't connect to that because it's not valid.
>> > >
>> > > On Sat, Jul 9, 2011 at 4:12 PM, Doron Rotem <doronrotem@gmail.com>
>> > wrote:
>> > >
>> > > > Thanks for your help, it helped clarify things,
>> > > > but it still doesn't work.
>> > > >
>> > > > i made the changes as you suggested, the hook file is back with
5985,
>> > and
>> > > > couchdb-lucene.ini has this content:
>> > > > [couchdb]
>> > > > os_process_timeout=60000 ; increase the timeout from 5 seconds.
>> > > >
>> > > > [external]
>> > > > fti=/Users/doron/.virtualenvs/py24/bin/python
>> > > >
/usr/local/Cellar/couchdb-lucene/0.6.0/tools/couchdb-external-hook.py
>> > > >
>> > > > [httpd_db_handlers]
>> > > > _fti = {couch_httpd_external, handle_external_req, <<"fti">>}
>> > > >
>> > > > *[local]*
>> > > > *url = http://localhost:5986/*
>> > > >
>> > > >
>> > > > However the response I get when accessing the view is:
>> > > >
>> > > > {"reason":"Connection to http://localhost:5984 refused","code":500}
>> > > >
>> > > >
>> > > > and the log shows this:
>> > > >
>> > > > WARNING: /local/p_cb/_design/search/by_title:
>> > > > org.apache.http.conn.HttpHostConnectException: Connection to
>> > > > http://localhost:5984 refused
>> > > >
>> > > >
>> > > >
>> > > > It seems it tries to reach port 5984, and fails because my couch
runs
>> > on
>> > > > port 5986.
>> > > >
>> > > > So, I configured couchdb to run on 5984 and it worked. cool!
>> > > > It worked despite the fact that the couchdb-lucene.ini file says
>> > couchdb
>> > > > runs on 5986! it seems it doesn't care about these settings. I
moved
>> > the
>> > > > [local] part to the top of the file. It didn't helped either. Maybe
I
>> > > have
>> > > > some error in my conf file or maybe couchdb-lucene ignores it.
>> > > >
>> > > > I had a look at the code and saw that HttpClientFactory.java have
>> 5984
>> > > > hardcoded in the method getInstance.
>> > > > Maybe this is the problem. I didn't see it is over written later by
>> the
>> > > > config value, but I only invested a few minutes in this and my
>> > > > understanding
>> > > > of the code is limited.
>> > > >
>> > > > thanks for your help anyway.
>> > > > doron
>> > > >
>> > > >
>> > > >
>> > > > On Sat, Jul 9, 2011 at 6:16 PM, Robert Newson <
>> robert.newson@gmail.com
>> > > > >wrote:
>> > > >
>> > > > > Ah, sorry, now I pay closer attention, you have your settings
>> > confused.
>> > > > >
>> > > > > The --remote-port is to help couchdb find couchdb-lucene, so
you
>> > don't
>> > > > > need to change it.
>> > > > >
>> > > > > You do, however, need to tell couchdb-lucene how to find couchdb.
>> If
>> > > > > you look in couchdb-lucene.ini you'll find this;
>> > > > >
>> > > > > # couchdb server mappings
>> > > > >
>> > > > > [local]
>> > > > > url = http://localhost:5984/
>> > > > >
>> > > > > change this 5984 to 5986 and you should be up and running.
>> > > > >
>> > > > > B.
>> > > > >
>> > > > > On 9 July 2011 16:06, Robert Newson <robert.newson@gmail.com>
>> wrote:
>> > > > > > couchdb-lucene should be writing a log in the logs/ subfolder
of
>> > > > > > wherever you unpacked the zip or tar to.
>> > > > > >
>> > > > > > I've not tried switching to an alternative port since the
first
>> > time
>> > > > > > those options were added to the hook script, but it did
work at
>> the
>> > > > > > time.
>> > > > > > B.
>> > > > > >
>> > > > > > On 8 July 2011 18:18, Doron Rotem <doronrotem@gmail.com>
wrote:
>> > > > > >> Hi,
>> > > > > >>
>> > > > > >> Hope this is the right place to ask help on couchdb-lucene.
>> > > > > >> I am trying to use it on Mac OS X 10.6.4
>> > > > > >>
>> > > > > >> I already had a couchdb running on my mac. I installed
>> > > couchdb-lucene
>> > > > > using:
>> > > > > >> brew install couchdb-lucene
>> > > > > >>
>> > > > > >>
>> > > > > >> i configured both /usr/local/etc/couchdb/default.ini
and
>> > > > > >> /usr/local/etc/couchdb/local.ini:
>> > > > > >>
>> > > > > >> [couchdb]
>> > > > > >> os_process_timeout=60000 ; increase the timeout from
5
seconds.
>> > > > > >>
>> > > > > >> [external]
>> > > > > >> fti=/Users/doron/.virtualenvs/py24/bin/python
>> > > > > >>
>> > > /usr/local/Cellar/couchdb-lucene/0.6.0/tools/couchdb-external-hook.py
>> > > > > >> --remote-host=http://127.0.0.1 --remote-port=5986
>> > > > > >>
>> > > > > >> [httpd_db_handlers]
>> > > > > >> _fti = {couch_httpd_external, handle_external_req, <<"fti">>}
>> > > > > >>
>> > > > > >>
>> > > > > >>
>> > > > > >> as you can see my couchdb runs on port 5986, not 5984.
>> > > > > >> i wasn't sure the --remote-port args worked so I changed
the
>> > > > > >> couchdb-external-hook.py file to have 5986 as default.
>> > > > > >>
>> > > > > >>
>> > > > > >> Starting couchdb:
>> > > > > >>
>> > > > > >> Apache CouchDB 1.0.2 (LogLevel=info) is starting.
>> > > > > >> Apache CouchDB has started. Time to relax.
>> > > > > >> [info] [<0.31.0>] Apache CouchDB has started on
>> > > > http://127.0.0.1:5986/
>> > > > > >>
>> > > > > >>
>> > > > > >>
>> > > > > >> Starting couchdb-lucene:
>> > > > > >>
>> > > > > >> /usr/local/Cellar/couchdb-lucene/0.6.0/bin/run
>> > > > > >>
>> > > > > >> 2011-07-07 18:05:06,014 INFO [Main] Index output goes
to:
>> > > > > >> /usr/local/Cellar/couchdb-lucene/0.6.0/indexes
>> > > > > >> 2011-07-07 18:05:06,098 INFO [Main] Accepting connections
with
>> > > > > >> SelectChannelConnector@localhost:5985
>> > > > > >> Jul 7, 2011 6:05:06 PM org.mortbay.log.Slf4jLog info
>> > > > > >> INFO: Logging to
>> > org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log)
>> > > > via
>> > > > > >> org.mortbay.log.Slf4jLog
>> > > > > >> Jul 7, 2011 6:05:06 PM org.mortbay.log.Slf4jLog info
>> > > > > >> INFO: jetty-6.1.20
>> > > > > >> Jul 7, 2011 6:05:06 PM org.mortbay.log.Slf4jLog info
>> > > > > >> INFO: Started SelectChannelConnector@localhost:5985
>> > > > > >>
>> > > > > >>
>> > > > > >>
>> > > > > >> my design doc:
>> > > > > >>
>> > > > > >> {
>> > > > > >> "_id": "_design/search",
>> > > > > >> "_rev": "6-ffa3f1a09f6f12f92ce3766c5ebe64f6",
>> > > > > >> "fulltext": {
>> > > > > >> "by_title": {
>> > > > > >> "index": "function(doc) { if (doc.doc_type ==
>> 'content'
>> > &&
>> > > > > >> doc.title) { var ret=new Document(); ret.add(doc.title);
return
>> > ret;
>> > > }
>> > > > > }"
>> > > > > >> }
>> > > > > >> },
>> > > > > >> "language": "javascript"
>> > > > > >> }
>> > > > > >>
>> > > > > >>
>> > > > > >> when i browse to http://127.0.0.1:5985/ i get this response:
>> > > > > >> {"couchdb-lucene":"Welcome","version":"0.6.0"}
>> > > > > >>
>> > > > > >> when i browse to
>> > > > > >>
>> > http://127.0.0.1:5986/my-db-name/_fti/_design/search/by_title?q=howi
>> > > > > get
>> > > > > >> this response:
>> > > > > >> {"error":"not_found","reason":"no_db_file"}
>> > > > > >>
>> > > > > >> the logs i see for couchdb are: [info] [<0.103.0>]
127.0.0.1 -
-
>> > > 'GET'
>> > > > > >> /p_cb/_fti/_design/search/by_title?q=how 404
>> > > > > >>
>> > > > > >> i don't see any logs for couchdb-lucene.
>> > > > > >>
>> > > > > >> I am probably missing a tiny thing, but can't find it.
i am
not
>> > mis
>> > > > > spelling
>> > > > > >> the db name, that's for sure.
>> > > > > >>
>> > > > > >> thanks for your help,
>> > > > > >>
>> > > > > >>
>> > > > > >>
>> > > > > >> --
>> > > > > >> doron
>> > > > > >>
>> > > > > >
>> > > > >
>> > > >
>> > > >
>> > > >
>> > > > --
>> > > > doron
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Keith Gable
>> > > A+ Certified Professional
>> > > Network+ Certified Professional
>> > > Web Developer
>> > >
>> >
>> >
>> >
>> > --
>> > doron
>> >
>>
>>
>>
>> --
>> Keith Gable
>> A+ Certified Professional
>> Network+ Certified Professional
>> Web Developer
>>
>
>
>
> --
> doron

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message