You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:56:28 UTC

[sling-org-apache-sling-nosql-couchbase-resourceprovider] 04/13: SLING-5077 NoSQL Couchbase Resource Provider: Make index creation compatible with Couchbase 4.0 RC0

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.nosql.couchbase-resourceprovider-1.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-nosql-couchbase-resourceprovider.git

commit 4b01d05961bc38cf1e994f8cbef84973eeecc1d3
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Sep 29 21:55:12 2015 +0000

    SLING-5077 NoSQL Couchbase Resource Provider: Make index creation compatible with Couchbase 4.0 RC0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/nosql/couchbase-resourceprovider@1705931 13f79535-47bb-0310-9956-ffa450edef68
---
 .../couchbase/resourceprovider/impl/CouchbaseNoSqlAdapter.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/nosql/couchbase/resourceprovider/impl/CouchbaseNoSqlAdapter.java b/src/main/java/org/apache/sling/nosql/couchbase/resourceprovider/impl/CouchbaseNoSqlAdapter.java
index d7730e9..12302fa 100644
--- a/src/main/java/org/apache/sling/nosql/couchbase/resourceprovider/impl/CouchbaseNoSqlAdapter.java
+++ b/src/main/java/org/apache/sling/nosql/couchbase/resourceprovider/impl/CouchbaseNoSqlAdapter.java
@@ -37,7 +37,6 @@ import com.couchbase.client.java.Bucket;
 import com.couchbase.client.java.document.JsonDocument;
 import com.couchbase.client.java.document.json.JsonObject;
 import com.couchbase.client.java.error.DocumentAlreadyExistsException;
-import com.couchbase.client.java.query.Index;
 import com.couchbase.client.java.query.N1qlParams;
 import com.couchbase.client.java.query.N1qlQuery;
 import com.couchbase.client.java.query.N1qlQueryResult;
@@ -63,8 +62,9 @@ public final class CouchbaseNoSqlAdapter extends AbstractNoSqlAdapter {
         this.cacheKeyPrefix = cacheKeyPrefix;
         
         // make sure primary index and index on parentPath is present - ignore error if it is already present
-        Index.createPrimaryIndex().on(couchbaseClient.getBucketName());
-        Index.createIndex(PN_PARENT_PATH).on(couchbaseClient.getBucketName(), x(PN_PARENT_PATH));
+        Bucket bucket = couchbaseClient.getBucket();
+        bucket.query(N1qlQuery.simple("CREATE PRIMARY INDEX ON `" + couchbaseClient.getBucketName() + "`"));
+        bucket.query(N1qlQuery.simple("CREATE INDEX " + PN_PARENT_PATH + " ON `" + couchbaseClient.getBucketName() + "`(" + PN_PARENT_PATH + ")"));
     }
 
     @Override

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.