Permalink
Browse files

add couchdb-lucene support

  • Loading branch information...
caolan committed Jun 10, 2012
1 parent 2c13021 commit 44115658078d8d056148be6283dda32a1e45b66c
Showing with 285 additions and 9,575 deletions.
  1. +5 −5 css/users.css
  2. +22 −1 ddoc/ddoc.js
  3. +0 −9,404 js/jquery-1.7.2.js
  4. +17 −0 js/jquery-1.7.2.min.js
  5. +9 −0 js/jquery.ba-throttle-debounce.min.js
  6. +0 −91 js/jquery.dispatch.js
  7. +12 −0 js/jquery.dispatch.min.js
  8. +2 −1 kanso.json
  9. +11 −2 templates/home.html
  10. +0 −5 ui/app.js
  11. +41 −6 ui/profiles.js
  12. +166 −60 ui/views/home.js
View
@@ -52,7 +52,7 @@
min-height: 150px;
}
-#profilelist {
+#profile-list {
margin: 1.618em 0;
padding: 0;
list-style-type: none;
@@ -74,16 +74,16 @@ li.profile .details {
li.profile .name {
font-weight: bold;
}
-#profilelist-nav .prev-link {
+#profile-list-nav .prev-link {
margin-right: 1em;
}
-#profilelist-nav .next-link {
+#profile-list-nav .next-link {
margin-left: 1em;
}
-#profilelist-nav .disabled {
+#profile-list-nav .disabled {
color: #999;
cursor: default;
}
-#profilelist-nav .disabled:hover {
+#profile-list-nav .disabled:hover {
text-decoration: none;
}
View
@@ -15,7 +15,7 @@ exports.views = {
exports.validate_doc_update = function (newDoc, oldDoc, userCtx) {
if ((oldDoc && oldDoc.type === 'profile') || newDoc.type === 'profile') {
- for (var i = 0; i < userCtx.roles.lenth; i++) {
+ for (var i = 0; i < userCtx.roles.length; i++) {
if (userCtx.roles[i] === '_admin') {
// _admin users can do anything
return;
@@ -46,3 +46,24 @@ exports.validate_doc_update = function (newDoc, oldDoc, userCtx) {
}
}
};
+
+exports.fulltext = {
+ profiles: {
+ index: function (doc) {
+ if (doc.type === 'profile') {
+ var ret = new Document();
+
+ ret.add(doc.name, {boost: 2.0});
+ ret.add(doc.full_name, {boost: 2.0});
+
+ ret.add(doc.location, {field: 'location'});
+ ret.add(new Date(doc.joined), {type: 'Date', field: 'joined'});
+ ret.add(doc.website, {field: 'website'});
+ ret.add(doc.twitter, {field: 'twitter'});
+ ret.add(doc.bio, {field: 'bio'});
+
+ return ret;
+ }
+ }
+ }
+};
Oops, something went wrong.

0 comments on commit 4411565

Please sign in to comment.