1

I'm trying to create a partitioned index using the below query in Couchbase

CREATE INDEX adv_firstOpen ON data(state, name, zip, status) 
WHERE type = 'Event' and name = 'firstOpen'
WITH {"num_partition":4, 
"nodes":["node1:9001", "node2:9001", "node3:9001","node4:9001" ]}

but creating replication index

enter image description here

what is the issue in creating an index query?

KARTHIKEYAN.A
  • 18,210
  • 6
  • 124
  • 133

1 Answers1

2

After reading the Couchbase document got an idea to create a proper index

CREATE INDEX adv_firstOpen ON data(state, name, zip, status) 
PARTITION BY HASH(state) 
WHERE type = 'Event' and name = 'firstOpen' WITH {"num_partition":4}

here num_partition is enough in with condition and PARTITION BY HASH must be mention

enter image description here

KARTHIKEYAN.A
  • 18,210
  • 6
  • 124
  • 133
  • 1
    Has PARTITION BY HASH(exprs) are must for partition index. otherwise it ignores num_partition. – vsr Jun 04 '21 at 20:06