Secondary Index Creation

The Aerospike Knowledge Base has moved to Content on is being migrated to either or Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via


How do I check if a secondary index already exists? AQL will show me all the indexes but in the Java client I don’t see how to do it. I see that I don’t get any exception if I make a call to recreate an index that already exists. In that case does it a NOOP on the server or are there any side effects like re-indexing?


We recommend using SINDEX as a parameter of ASINFO for querying if a secondary index.

$ asinfo -v "sindex"

Please see the examples in the following link for a more detailed usage of SINDEX SINDEX Doc

In the Java client API, you can use either of the ‘request’ methods provided for the query. We recommend the following one for SINDEX for getting one info value by name from the specified database server node. Take a look at the following page., java.lang.String)

When trying recreate the same index the the server returns error and does nothing. Java/C# clients will swallow this error and not throw exception. However, if it is exactly same bintype, set, namespace, it will do some network messaging and then NOOP.