Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D3BC5D53C for ; Fri, 20 Jul 2012 21:17:13 +0000 (UTC) Received: (qmail 45202 invoked by uid 500); 20 Jul 2012 21:17:12 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 45181 invoked by uid 500); 20 Jul 2012 21:17:12 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 45173 invoked by uid 99); 20 Jul 2012 21:17:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2012 21:17:12 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.160.180] (HELO mail-gh0-f180.google.com) (209.85.160.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2012 21:17:05 +0000 Received: by ghbz12 with SMTP id z12so4778922ghb.11 for ; Fri, 20 Jul 2012 14:16:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:content-type:x-gm-message-state; bh=kyFcD8fqz5nh78cZxiHpM6ZaqhEh8y7OWXlr2OElHjk=; b=LD2RtpuH/mB/4IW2YHywECuRX09R2W8b7NyUMDy5H0uXxpW4lWMLYfUFVSGxqPokEy t6ZEkTxa5/gbsFD/lpSQjsQVUlvDZ40EvzF8EUXZWytSyYmRi10cRz6y/1TLmojLoln/ QuSURPOul0sBixFBkrXWq9yWFJ1+cxCeFV1ZmZ0O5ge43BO5VZFnSpkkKZbaN0cuHugx 4FtEpxW+myftjb3uMHyyFH9pJm3LtabMJM6lZVQbGEbBaLfelFATBV2S74MV+wljZ561 GcyW+bcW1IN3yfqmEcBf7eqoUA3/FJZ8XafihjHxwDTmZV1kziGZMtiOvrftp75G37U9 7sVA== Received: by 10.50.154.233 with SMTP id vr9mr9540728igb.9.1342819002947; Fri, 20 Jul 2012 14:16:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.24.10 with HTTP; Fri, 20 Jul 2012 14:16:22 -0700 (PDT) X-Originating-IP: [68.5.117.177] In-Reply-To: References: <4C598FE8-7637-4863-8577-3B5C39A74042@apache.org> <5009181D.4060503@resourceandrevenue.com> From: Mark Hahn Date: Fri, 20 Jul 2012 14:16:22 -0700 Message-ID: Subject: Re: noob problem getting started with lucene To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=14dae93407f5ab16b904c5496908 X-Gm-Message-State: ALoCoQmTAgr8o+IA3S5KBKEIVJt4cF25UZPv88Z2W3GlFHkjcmazqw1hPr04vpo+IWZveLUCxqb1 --14dae93407f5ab16b904c5496908 Content-Type: text/plain; charset=ISO-8859-1 Could the problem be that the indexes folder is empty? Is there something I'm supposed to do to initialize the index? The readme mentions nothing about this. On Fri, Jul 20, 2012 at 10:15 AM, Mark Hahn wrote: > My local.ini for couch looks like this. It shows up in the config page of > futon. And the example that uses _fit works. > > [httpd_global_handlers] > _fti = {couch_httpd_proxy, handle_proxy_req, <<"http://127.0.0.1:5985 > ">>} > > curl http://root:xxx@localhost:**5984/_fti > {"couchdb-lucene":"Welcome","**version":"0.9.0-SNAPSHOT"} > > curl http://root:xxx@localhost:5984/ri/_fti/_design/aaa/** > name?q=The+Buddy+Group > {"error":"not_found","reason":**"missing"} > > Doesn't the console output above show that couch.ini is setup and the > proxy _fti is working? It is only the request that isn't working. > > > On Fri, Jul 20, 2012 at 1:34 AM, Kai Griffin wrote: > >> Could be something not quite right in the relevant sections of your >> local.ini? The two "contradictory" request formats you mentioned earlier >> represent the old and the new way that couch handles external requests >> (couchdb-lucene in this case). So, seeing that part of your local.ini >> might help get to the bottom of it, hopefully... >> >> >> >> On 20/07/2012 01:22, Mark Hahn wrote: >> >>> Thanks so much for the help. >>> >>> What I showed was actually the contents of the design doc fulltext field >>> as >>> shown in futon. I should have said so. Here is the entire unadulterated >>> source of the design doc. I think it is correct. >>> >>> { >>> >>> "_id": "_design/aaa", >>> "_rev": "57-**31ea676b8139d4ef3a1a04d11fb952**e0", >>> .... views and updates snipped .... >>> "fulltext": { >>> "name": { >>> "index": "function (doc) { var ret; if (doc.name && >>> !doc.closed && !doc._deleted) { ret = new Document(); >>> ret.add(doc.name); log.info('hello lucene world'); return ret; } }" >>> } >>> } >>> } >>> >>> >>> I just noticed that my original post has a mistake. The second curl >>> example showed the wrong response. Here it is again with the exact >>> command >>> I used (except for password). >>> >>> curl http://root:xxx@localhost >>> :5984/ri/_fti/_design/aaa/**name?q=The+Buddy+Group >>> {"error":"not_found","reason":**"missing"} >>> >>> When I googled this result I found this error in a lot of posts where the >>> author had the _fti incorrectly set up in couch. But I think this >>> console >>> output proves that my _fti is correct. No? >>> >>> curl http://root:xxx@localhost:**5984/_fti >>> {"couchdb-lucene":"Welcome","**version":"0.9.0-SNAPSHOT"} >>> >>> >>> On Thu, Jul 19, 2012 at 3:26 PM, Robert Newson >>> wrote: >>> >>> Your design document looks wrong to me (or you've omitted important >>>> parts >>>> of it). Here's the one from the README for comparison; >>>> >>>> { >>>> "_id":"_design/foo", >>>> "fulltext": { >>>> "by_subject": { >>>> "index":"function(doc) { var ret=new Document(); >>>> ret.add(doc.subject); return ret }" >>>> }, >>>> "by_content": { >>>> "index":"function(doc) { var ret=new Document(); >>>> ret.add(doc.content); return ret }" >>>> } >>>> } >>>> } >>>> >>>> Note: the top-level key is called "fulltext", this is absent from your >>>> design document. >>>> >>>> B. >>>> >>>> On 19 Jul 2012, at 19:25, Mark Hahn wrote: >>>> >>>> (I posted this as an issue on rnewson/couchdb-lucene and I moved it >>>>> here) >>>>> >>>>> I cannot get a lucene query to work and need help. >>>>> >>>>> Lucene is running ok and the proxy from couchdb to lucene is working. >>>>> >>>>> curl http://127.0.0.1:5985 >>>>> {"couchdb-lucene":"Welcome","**version":"0.9.0-SNAPSHOT"} >>>>> >>>>> curl http://root:tbgcomps2@**localhost:5984/_fti >>>>> {"couchdb-lucene":"Welcome","**version":"0.9.0-SNAPSHOT"} >>>>> >>>>> My index view looks like this but the indexes directory is empty. When >>>>> >>>> is >>>> >>>>> Lucene supposed to create the index? On the first request? >>>>> >>>>> { >>>>> name: { >>>>> index: function (doc) { >>>>> var ret; >>>>> if (doc.name && !doc.closed && !doc._deleted) { >>>>> ret = new Document(); >>>>> ret.add(doc.name); >>>>> return ret; >>>>> } >>>>> } >>>>> } >>>>> } >>>>> >>>>> I've tried both of these URLs. They are based on two different >>>>> examples >>>>> >>>> in >>>> >>>>> the readme, which seem to be contradictory formats. >>>>> >>>>> Readme example: >>>>> http://127.0.0.1:5984/_fti/**local/db1/_design/cl-test/idx?**q=hello >>>>> >>>>> curl >>>>> http://localhost:5984/_fti/**local/mydb/_design/mydesign/** >>>>> name?q=testname >>>>> {"reason":"bad_request","code"**:500} >>>>> >>>>> Readme example: >>>>> http://localhost:5984/**database/_fti/_design/foo/by_**subject?q=hello >>>>> >>>>> curl >>>>> >>>> http://localhost:5984/mydb/_**fti/_design/mydesign/name?q=**testname >>>> >>>>> {"reason":"bad_request","code"**:400} >>>>> >>>>> Can someone suggest what I might be doing wrong? >>>>> >>>> >>>> >> > --14dae93407f5ab16b904c5496908--