2017-09-10 22 views
0

指數函數使用CouchDB的 - lucene的

我怎麼能指數嵌套的對象時,我嘗試在索引功能的doc指數子屬性,如 ret.add(doc.complaint.status, {field: 'status', type: 'string'}) CouchDB的,Lucene的收益500

function (doc) { 
 
    var ret = new Document(); 
 

 
    ret.add(doc.customerName, { 
 
    type: 'string', 
 
    field: 'customerName' 
 
    }); 
 

 
    ret.add(doc.complaint.status, { 
 
    type: 'string', 
 
    field: 'status' 
 
    }); 
 

 
    ret.add(doc.complaint.numberOfCoupons, { 
 
    type: 'int', 
 
    field: 'numberOfCoupons' 
 
    }); 
 

 
    return ret; 
 
}

存在於couchdb中的物體

{ "customerName": "Roman Maltsev", "complaint": { "status": "In progress", "numberOfCoupons": 10 } }

查詢使用代理 GET http://localhost:5984/_fti/local/complaints-management-rom/_design/find/all?q=status:"In progress" 收益500

回答

0

其實,問題是,Lucene索引每個文檔,包括_design /視圖本身,所以我只需要檢查沒有財產的存在與否