Searching a LIST INDEX and get AEROSPIKE_ERR_INDEX_NOT_FOUND

Hi,

I’m trying to search on a secondary list index in aerospike community 3.12.1.1 i’ve tried both with aql and nodejs and get the same result, here below is how to reproduce the AEROSPIKE_ERR_INDEX_NOT_FOUND I see.

INSERT INTO test.tweet (PK, user, tag, text) VALUES (1, 'karl', LIST('["test", "tagy"]'), 'tweet text one')
INSERT INTO test.tweet (PK, user, tag, text) VALUES (2, 'chris', LIST('["life", "sports"]'), 'tweet text two')

SELECT * from test.tweet
+---------+-----------------------------+------------------+
| user    | tag                         | text             |
+---------+-----------------------------+------------------+
| "chris" | LIST('["life", "sports"]')  | "tweet text two" |
| "karl"  | LIST('["test", "tagy"]')    | "tweet text one" |
+---------+-----------------------------+------------------+


CREATE LIST INDEX TweetTags ON test.tweet (tag) STRING;
SELECT * from test.tweet WHERE tag='life'
0 rows in set (0.000 secs)
Error: (201) AEROSPIKE_ERR_INDEX_NOT_FOUND

Answering my own question. Have to use the “IN”
SELECT * from test.tweet IN LIST WHERE tag=‘life’

1 Like

Thanks for posting the solution! :slight_smile:

1 Like