couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: noob problem getting started with lucene
Date Thu, 19 Jul 2012 22:26:16 GMT
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?


Mime
View raw message