Getting error when using equals() predicate on a query

I’d like to get a query of records containing an exact match with a particular bin

I first do

query = client.query(‘test’, ‘raw_data’)

query.where(p.equals(‘processed’, 0))

and so far no errors. However, when i try to print the results using


I get the following error

exception.IndexNotFound: (201L, ‘AEROSPIKE_ERR_INDEX_NOT_FOUND’, ‘src/main/aerospike/aerospike_query.c’, 228)

Does this mean I have to put an index on any bin which I might ever want to query for? if yes, how exactly, and if no, then what would be the way to achieve this?

thanks a lot :blush:

Fixed the problem by adding index to the required bin.

command used:

CREATE INDEX numindex ON <namespace>.<set>(<bin>) NUMERIC

1 Like

You got it. Here’s some reference:

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.