incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slymak <sly...@gmail.com>
Subject search non-alphanumeric string in attachments
Date Mon, 13 Dec 2010 13:09:17 GMT
Using couchdb-lucene-0.5.6 I want search for non-alphanumeric chars like
&DBID or DSN=PDUTL01.L#@TP11.PFU.PFLOUT, in attachment.
I think I have problem set up right analyzer for index. Analyzer "keyword"
could do it.

Creating index like:
{
    "_id":"_design/searchkey",
    "fulltext": { "analyzer":"keyword",
        "by_name": {"index":"
                    function(doc) {
                    var result = new Document();
                    for(var a in doc._attachments) {
                    result.attachment('default',a);
                             } return result;}"
                    }
    }
}

and query like
curl  -X GET  "
http://localhost:5984/pfl20101206/_fti/_design/searchkey/by_name?debug=true&limit=3&analyzer=keyword&q=%25dbid
"


I got same result as asking only for dbid. (In my db are 660 matches for
DBID and only 4 matches for &DBID)
  "q": "default:dbid",
  "plan": "TermQuery(default:dbid,boost=1.0)",
  "etag": "3f0238ac3d3b1",
  "skip": 0,
  "limit": 3,
  "total_rows": 660,
  "search_duration": 5,
  "fetch_duration": 0,


I tested whitespace analyzer too. It should be case sensitive. In my case it
isn't.

Any idea please what I'm doing wrong?
thanks slymak

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