rnewson / couchdb-lucene

Enables full-text searching of CouchDB documents using Lucene
Apache License 2.0
769 stars 147 forks source link

zero fields indexed #268

Closed vimalabhi89 closed 6 years ago

vimalabhi89 commented 6 years ago

Hi rnewson,

An example doc:

{
  "_id": "939ff7c2a8asfkj908wgsgdgggdgg",
  "_rev": "1-1a5adca8b3c229esf8ste7sgs7ts",
  "sex": "M",
  "age": 55.8,
  "subject_id": "fsfj35355",
  "subject_comment": "This is a test user.",
  "type": "subject"
}

Indexed as below:

{
  "_id": "_design/foo",
  "_rev": "6-1b45904c9ce4325d27049e10102a441e",
  "fulltext": {
    "by_subject": {
      "index": "function(doc) {var ret=new Document();ret.add(doc.subject_id,{'field':'subject_id', 'store':'yes'}); ret.add(doc.type,{'field':'type', 'store':'yes'}); return ret; }"
    }
  }
}

curl localhost:5985/local/dbName/_design/foo/by_subject returns zero doc_count and empty fields

{"current":true,"doc_count":0,"digest":"3063p3oazx5p237dqdgqtpnen","update_seq":"start","disk_size":0,"doc_del_count":0,"fields":[],"ref_count":2,"uuid":"18bd1

Using Couch 2.1. Is there something that I'm missing here? And because of zero count, trying to search would return {code:500}

Is there anything that needs to be done after creating the index view?

vimalabhi89 commented 6 years ago

It was my bad that I had installed the earlier version of lucene and obviously it didn't work out. Sorry, and I'm providing the link here for the couch2.0 compatible lucene 2.0.0 version https://github.com/rnewson/couchdb-lucene/releases/tag/v2.0.0 Thanks for all the help through the issues and comments