Better score for filling in blank fields
[disclosr.git] / include / couchdb.inc.php
blob:a/include/couchdb.inc.php -> blob:b/include/couchdb.inc.php
--- a/include/couchdb.inc.php
+++ b/include/couchdb.inc.php
@@ -29,12 +29,14 @@
 
 function(doc) {
 count = 0;
+if (typeof(doc["status"]) == "undefined" || doc["status"] != "suspended") {
 for(var propName in doc) {
       if(typeof(doc[propName]) != "undefined" && propName.startsWith("l")) {
   	count++
 	}
 }
-  emit(doc._id,{name: doc.name, score:count});
+  emit(count+doc._id, {id:doc._id, name: doc.name, score:count});
+  }
 }';
 
     // allow safe updates (even if slightly slower due to extra: rev-detection check).
@@ -43,7 +45,7 @@
 
 require ('couchdb/settee/src/settee.php');
 
-$server = new SetteeServer('http://127.0.0.1:5984');
+$server = new SetteeServer('http://192.168.1.8:5984');
 
 function setteErrorHandler($e) {
     echo $e->getMessage() . "<br>" . PHP_EOL;