--- a/include/couchdb.inc.php +++ b/include/couchdb.inc.php @@ -51,9 +51,17 @@ $obj->views->byName->map = 'function(doc) { if (typeof(doc["status"]) == "undefined" || doc["status"] != "suspended") { emit(doc.name, doc._id); +if (typeof(doc.shortName) != "undefined" && doc.shortName != doc.name) { + emit(doc.shortName, doc._id); +} for (name in doc.otherNames) { if (doc.otherNames[name] != "" && doc.otherNames[name] != doc.name) { emit(doc.otherNames[name], doc._id); +} + } + for (name in doc.foiBodies) { +if (doc.foiBodies[name] != "" && doc.foiBodies[name] != doc.name) { + emit(doc.foiBodies[name], doc._id); } } }