the name search view should be in the 'search' design doc really...

This commit is contained in:
Gered 2014-04-06 16:18:42 -04:00
parent bd77f12095
commit cd1620e9d6
3 changed files with 5 additions and 5 deletions

View file

@ -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}"
}
}
}

View file

@ -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}"
}
}
}

View file

@ -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)))