Skip to content

Question. QueryPolicy.filterExp is use by 2nd index? #189

@boojongmin

Description

@boojongmin

I read this #33

but I need search multiple bin with index.

aerospikeClient.createIndex(
    null, "hello", "hello",
    "idx_1", "hello1", IndexType.STRING,
    IndexCollectionType.DEFAULT
).awaitFirstOrNull()

aerospikeClient.createIndex(
    null, "hello", "hello",
    "idx_2", "hello2", IndexType.STRING,
    IndexCollectionType.DEFAULT
).awaitFirstOrNull()


val policy = QueryPolicy()
policy.filterExp = Exp.build(
        Exp.and(
            Exp.eq(Exp.bin("hello1", Exp.Type.STRING), Exp.`val`("asdf")),
            Exp.eq(Exp.bin("hello2", Exp.Type.STRING), Exp.`val`("defg"))
        ),
)

val v = aerospikeClient.query(policy, statement).awaitFirstOrNull()

is this code will use index?

and... how I know search rules like sql explain

thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions