Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Lance format Lance Java IndexCriteria

From Leeroopedia


Knowledge Sources
Domains Java_SDK, Indexing
Last Updated 2026-02-08 19:33 GMT

Overview

Description

IndexCriteria is a final Java class in the org.lance.index package that defines criteria for describing or selecting indices on a Lance dataset. It mirrors the semantics of the Rust IndexCriteria struct used by Dataset::describe_indices and related APIs. The class uses an immutable design with a Builder pattern and allows filtering indices by column name, index name, full-text search support, and exact equality predicate support.

Usage

IndexCriteria is constructed via its inner Builder class and passed to dataset methods that list or describe indices. By setting criteria fields, callers can narrow down which indices are returned. All filter fields are optional; when omitted, all indices are considered.

Code Reference

Source Location

java/src/main/java/org/lance/index/IndexCriteria.java

Signature

public final class IndexCriteria {
    public Optional<String> getForColumn();
    public Optional<String> getHasName();
    public boolean mustSupportFts();
    public boolean mustSupportExactEquality();

    public static final class Builder {
        public Builder forColumn(String forColumn);
        public Builder hasName(String name);
        public Builder mustSupportFts(boolean mustSupportFts);
        public Builder mustSupportExactEquality(boolean mustSupportExactEquality);
        public IndexCriteria build();
    }
}

Import

import org.lance.index.IndexCriteria;

I/O Contract

Builder Inputs
Parameter Type Required Default Description
forColumn String No null (no filter) Restrict to indices built on this column only
hasName String No null (no filter) Restrict to indices with this specific name
mustSupportFts boolean No false If true, only indices supporting full-text search
mustSupportExactEquality boolean No false If true, only indices supporting exact equality predicates
Accessor Outputs
Method Return Type Description
getForColumn() Optional<String> Column name filter, if set
getHasName() Optional<String> Index name filter, if set
mustSupportFts() boolean Whether FTS support is required
mustSupportExactEquality() boolean Whether exact equality support is required

Usage Examples

import org.lance.index.IndexCriteria;

// Find all indices on the "embedding" column
IndexCriteria criteria = new IndexCriteria.Builder()
    .forColumn("embedding")
    .build();

// Find a specific index by name
IndexCriteria byName = new IndexCriteria.Builder()
    .hasName("my_btree_idx")
    .build();

// Find indices that support full-text search
IndexCriteria ftsCriteria = new IndexCriteria.Builder()
    .mustSupportFts(true)
    .build();

// Combine criteria: column + exact equality support
IndexCriteria combined = new IndexCriteria.Builder()
    .forColumn("category")
    .mustSupportExactEquality(true)
    .build();

Related Pages

  • IndexDescription - Returned by describe-indices APIs that accept IndexCriteria
  • Index - Per-segment index metadata
  • IndexType - Enum classifying index types

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment