0
我想搜索文檔中的所有字段,而無需在使用Cloudant搜索索引時指定字段名稱。如何索引多個字段以便在不提供字段名稱的情況下查詢全部字段?
cloudant docs的提供關於doc._id默認字段索引的一個示例:
function(doc){
index("default", doc._id);
if (doc.min_length){
index("min_length", doc.min_length, {"store": true});
}
if (doc.diet){
index("diet", doc.diet, {"store": true});
}
if (doc.latin_name){
index("latin_name", doc.latin_name, {"store": true});
}
if (doc.class){
index("class", doc.class, {"store": true});
}
}
該文檔還提供這樣的描述:
如果特殊值「默認」用於當定義名稱,您不必在查詢時指定字段名稱。
我可以定義多一個「默認」索引嗎?例如。
function(doc){
index("default", doc._id);
index("default", doc.min_length, {"store": true});
...
}