Error for N1QL command : 5000 , time out


#1

guys m new on N1ql , trying to fire query for creating primary key on bucket,
using
CREATE INDEX id_ix on ram(meta().id);
(ram is bucket name)

it is giving error as
5000 - GSI CreateIndex() - cause: Request timed out. Index server may still be processing this request. Please check the status after sometime or retry.

please help me out.


#2

You can wait for some time, say 1 hour, and then issue:

SELECT name, state FROM system:indexes;

You want to see state = online for your index.


#3

tried for it. but it is not working . again it is showing
No primary index on keyspace ‘ram’. Use CREATE PRIMARY INDEX to create one


#4

is there any other method to create primary key for a bucket??


#5

Yes, you can create the index with deferred build, and then issue a BUILD command afterwards. This is in the documentation. Please consult the docs and try that, and then let us know.


#6

hi,
i have tried in several ways to assign the key for the bucket. bt it is showing continuously error as CREATE PRIMARY INDEX ON beer-sample USING GSI…
i have tried from console as well as cbq command line …still it is giving error like that only


#7

also tried several queries for creating or building primary key…

one more doubt … is this possible to fire other queries(like select) on bucket without giving primary key to that bucket???


#8

Yes. You can query using USE KEYS, or using a secondary index.


#9

I had a problem like this when I built a small dev server, and was addressing it using only its IP address. Got some very long response times. When I created a name for the server, entered the name (and IP) in my etc/hosts file, the server response time was much faster.


#10

Hi,
I ran

Select * From default Where Tag And Tag=="BankUserAccountInfo" USE KEYS;

but i got

[
{
“code”: 3000,
“msg”: “syntax error - at USE”,
“query_from_user”: “Select * From ShomaraDB Where Tag And Tag==“BankUserAccountInfo” USE KEYS;”
}
]


#11

Please consult the documentation.


#12

Hi,
could you please let me know, which and where ?

Thanks


#13

The use keys clause section has an example here.
http://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/from.html

Link to N1QL reference docs : http://developer.couchbase.com/documentation/server/4.5/n1ql/n1ql-language-reference/index.html

You can also take a look at the following blog.
http://blog.couchbase.com/sql-for-documents-n1ql-brief-introduction-to-query-planning

Thanks


#14

many thanks for your guidance