I have documents of the form:
{
"myfield": "something",
"xxx": "http://77426.222.com"
}
They all have keys of the form 1xxxxx
And this specific one has the key 100000
I am also storing other objects which have keys of the form 2xxxxx.
I only want to index the first kind of objects, so I use this:
CREATE INDEX
myindexON
bucket1(
myfield) WHERE ((meta().
id) like "1%") USING GSI
And after that I’m trying to run this query:
SELECT myfield FROM bucket1 WHERE myfield is not missing
This should just work right? Instead I’m getting:
[
{
"code": 4000,
"msg": "No index available on keyspace realtime that matches your query. Use CREATE INDEX or CREATE PRIMARY INDEX to create an index, or check that your expected index is online.",
"query_from_user": "SELECT myfield FROM bucket1 WHERE myfield is not missing"
}
]
What am I doing wrong here?