Skip to content
Browse files

work on fulltext query with lucene wrapper

  • Loading branch information...
1 parent 0db1e9c commit 00577aab1851e4991805e266cabbffa32fdb5175 Nathan committed
Showing with 17 additions and 9 deletions.
  1. +17 −9 lib/couchdb/database.js
View
26 lib/couchdb/database.js
@@ -227,27 +227,35 @@ Database = {
options = options || {};
options = util.deepCopy(options);
- options.limit = options.limit || 5;
options.include_docs = options.include_docs || false;
- operator = options.operator || "OR";
+ if (options.operator) {
+ operator = options.operator;
+ delete options.operator;
+ } else {
+ operator = "OR";
+ }
if (options.query) {
- options.q = "";
-
- for (var key in options.query){
- if (options.q != "") {
- options.q += " OR ";
+ if (typeof options.query === "string") {
+ options. q = options.query;
+ } else {
+ options.q = "";
+
+ for (var key in options.query){
+ if (options.q != "") {
+ options.q += " OR ";
+ }
+ options.q += key + ":" + options.query[key];
}
- options.q += key + ":" + options.query[key];
}
-
delete options.query;
}
var fullTextResult = [];
var uri = this.uri + "_fti/" + designDocName + "/" + fullTextViewName + encodeOptions(options);
+ print(uri);
this.httpClient.get(uri, {
async: false,

0 comments on commit 00577aa

Please sign in to comment.
Something went wrong with that request. Please try again.