the name search view should be in the 'search' design doc really...
This commit is contained in:
parent
bd77f12095
commit
cd1620e9d6
|
@ -11,10 +11,6 @@
|
|||
},
|
||||
"byDate": {
|
||||
"map": "function(doc) {\n emit(doc.name, doc.date)\n}"
|
||||
},
|
||||
"uniqueNames": {
|
||||
"map": "function(doc) {\n emit(doc.name, null)\n}",
|
||||
"reduce": "function(keys, values) {\n return null;\n}"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,6 +4,10 @@
|
|||
"views": {
|
||||
"hashes": {
|
||||
"map": "function(doc) {\n emit([doc.name, doc.hash], doc._id)\n}"
|
||||
},
|
||||
"names": {
|
||||
"map": "function(doc) {\n emit(doc.name, null)\n}",
|
||||
"reduce": "function(keys, values) {\n return null;\n}"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -76,5 +76,5 @@
|
|||
; to the search term and use it as the end key, effectively meaning "find all matches with keys
|
||||
; between 'prefix' and 'prefix\u9999'" which works because keys will be sorted lexicographically
|
||||
; by couchdb
|
||||
(->> (couch/get-view-with-db (db-library) "list" "uniqueNames" {:startkey query :endkey (str query "\u9999") :group true})
|
||||
(->> (couch/get-view-with-db (db-library) "search" "names" {:startkey query :endkey (str query "\u9999") :group true})
|
||||
(map :key)))
|
Reference in a new issue