createPayloadIndex
abstract suspend fun createPayloadIndex(name: String, field: String, schema: PayloadSchemaType, wait: Boolean = false)
Create a payload field index so filtering on field scales. Without an index, filters do a full scan.
qdrant.createPayloadIndex("docs", "lang", PayloadSchemaType.KEYWORD)Content copied to clipboard
abstract suspend fun createPayloadIndex(name: String, field: String, wait: Boolean = false, configure: PayloadIndexBuilder.() -> Unit)
Create a payload field index, choosing the parameters that index type accepts.
qdrant.createPayloadIndex("docs", "body") {
text { tokenizer = Tokenizer.WORD; phraseMatching = true }
}Content copied to clipboard
Two of those parameters decide whether a query works rather than how fast it is. A matchPhrase filter matches nothing unless the text index was built with phraseMatching = true, and a multi-tenant collection is only laid out per tenant if its tenant field's index says isTenant = true. The rest are cost, onDisk above all.
Throws
if configure names no index type, or more than one.