Queries are returning No Results

I’ve installed the travel-sample db and when I go to the Query section of the CouchBase web console, it shows travel-sample as a Fully Queryable Bucket.
However, a query like SELECT * FROM travel-sample limit 1; does not return a result.
A query like SELECT * FROM system:indexes WHERE name = ‘#primary’; does not return a result either.
It just doesn’t seem to be working, I’ve restarted the server and everything seems to be fine, no error in logs all services running, etc. but I just can’t seem to get any results.
The travel-sample bucket shows 31,591 documents so why isn’t this working?

Thanks.

Did your Indexer service is running. Check Index Status in the Indexes tab

Yes, indexer service is running and all the index have a status of ready and build progress at 100%. Everything looks good but just not working.

After execution paste the output of Plan Text tab here.

Also run the following query and see if that working

SELECT t.* 
FROM `travel-sample` AS t USE KEYS [  "airline_10",  "airline_10123","airline_10226"];

returns the following Plan:
{
“plan”: {
#operator”: “Sequence”,
“~children”: [
{
#operator”: “Sequence”,
“~children”: [
{
#operator”: “PrimaryScan”,
“index”: “def_primary”,
“keyspace”: “travel-sample”,
“limit”: “1”,
“namespace”: “default”,
“using”: “gsi”
},
{
#operator”: “Fetch”,
“keyspace”: “travel-sample”,
“namespace”: “default”
},
{
#operator”: “Parallel”,
“~child”: {
#operator”: “Sequence”,
“~children”: [
{
#operator”: “InitialProject”,
“result_terms”: [
{
“expr”: “self”,
“star”: true
}
]
},
{
#operator”: “FinalProject”
}
]
}
}
]
},
{
#operator”: “Limit”,
“expr”: “1”
}
]
},
“text”: “SELECT * FROM travel-sample limit 1;”
}

The query you provided worked and returned back 3 records.
Here’s the plan for that query:
{
“plan”: {
#operator”: “Sequence”,
“~children”: [
{
#operator”: “KeyScan”,
“keys”: “["airline_10", "airline_10123", "airline_10226"]”
},
{
#operator”: “Fetch”,
“as”: “t”,
“keyspace”: “travel-sample”,
“namespace”: “default”
},
{
#operator”: “Parallel”,
“~child”: {
#operator”: “Sequence”,
“~children”: [
{
#operator”: “InitialProject”,
“result_terms”: [
{
“expr”: “t”,
“star”: true
}
]
},
{
#operator”: “FinalProject”
}
]
}
}
]
},
“text”: “SELECT t.* \r\nFROM travel-sample AS t USE KEYS [ "airline_10", "airline_10123","airline_10226"];”
}

It looks like index might not indexed properly.
Go to Index Statistics and check number of indexed items.

You can drop the index and and re-create it and see if that works

DROP INDEX  `travel-sample`.def_primary;
CREATE PRIMARY INDEX ON `travel-sample`;

OR DROP the bucket and re-install travel-sample bucket

Thank you that was it. I noticed most of the indexes don’t have any items indexed. Not sure how that happend, when I first installed the bucket I was able to execute queries without any problems then it just stopped working. I never dropped an index. I will delete the bucket and re-install to fix all the other index. Thanks.