stargate / data-api

JSON document API for Apache Cassandra (formerly known as JSON API)
https://stargate.io
Apache License 2.0
14 stars 16 forks source link

Implement `listIndexes` command #1605

Open maheshrajamani opened 1 week ago

maheshrajamani commented 1 week ago

listIndexes command will be a table level command that will return indexes for a table.

By default return only the index names. Request:

{
    "listIndexes": {}
}

Response:

{
    "status": {
        "indexes": [
            "name_idx",
            "content_idx"
        ]
    }
}

If explain option is set to true return full index definition. Request:

{
    "listIndexes": {
        "options" : {
            "explain" : true
        }
    }
}

Response:

{
    "status": {
        "indexes": [
            {
                "name": "name_idx",
                "definition": {
                    "column": "name",
                    "options": {
                        "normalize": true,
                        "ascii": true
                    }
                }
            },
            {
                "name": "content_idx",
                "definition": {
                    "column": "content",
                    "options": {
                        "metric": "cosine",
                        "sourceModel": "openai_v3_small"
                    }
                }
            }
        ]
    }
}
amorton commented 1 day ago

Picking this up again