Call to undefined method Aerospike::createIndex()

php
secondary
error

#1

I’m testing Aerospike with PHP. Starting from the examples given in the doc, I can create a connection to my DB, choose my namespace, then insert some data (1 row) and retrieve it with the primary key ; so far so good.

At that stage, I’d like to add a secondary index.

    > $status = $db->createIndex("myNS", "mySet", "username", Aerospike::INDEX_TYPE_STRING, "username_idx");

But when I run it (command-line, “php test.php”), I get this:

PHP Fatal error: Call to undefined method Aerospike::createIndex()

What am I doing wrong?


#2

I assume you’re referring to the doc on the website, which is due for an update. The API contained in the repo on GitHub is always ahead on documentation, as that’s where the source is kept. createIndex() has been deprecated for a while in favor of addIndex(), and finally removed in release 3.4.6.


#3

oh, ok. Thanks, I’ll look there in the future.