Skip to content

feat(java): add builder-style scalar index params#5581

Merged
majin1102 merged 3 commits intolance-format:mainfrom
wojiaodoubao:java-fts-api-builder
Jan 7, 2026
Merged

feat(java): add builder-style scalar index params#5581
majin1102 merged 3 commits intolance-format:mainfrom
wojiaodoubao:java-fts-api-builder

Conversation

@wojiaodoubao
Copy link
Copy Markdown
Contributor

@wojiaodoubao wojiaodoubao commented Dec 25, 2025

Introduce some builder classes to make creating scalar index easy. For example.

  ScalarIndexParams params = BTreeIndexParams.builder()
      .zoneSize(2048)
      .build();

  IndexParams indexParams = IndexParams.builder().setScalarIndexParams(scalarParams).build();

   // Create BTree index on 'id' column
   dataset.createIndex(
       Collections.singletonList("id"),
       IndexType.BTREE,
       Optional.of("btree_id_index"),
       indexParams,
       true);

@github-actions github-actions Bot added enhancement New feature or request java labels Dec 25, 2025
@wojiaodoubao
Copy link
Copy Markdown
Contributor Author

wojiaodoubao commented Jan 4, 2026

Hi @BubbleCal , @majin1102 could you help review this when you have time, thanks very much~

Copy link
Copy Markdown
Contributor

@majin1102 majin1102 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me. left some comments.
Please take a look

Comment thread java/src/main/java/org/lance/index/scalar/JsonUtils.java Outdated
Comment thread java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java Outdated
Comment thread java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java
@wojiaodoubao wojiaodoubao force-pushed the java-fts-api-builder branch 2 times, most recently from 7d6dffa to 17d7e8d Compare January 6, 2026 06:39
Comment thread java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java Outdated
Comment thread java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java
@majin1102 majin1102 merged commit 55e8532 into lance-format:main Jan 7, 2026
8 checks passed
jackye1995 pushed a commit to jackye1995/lance that referenced this pull request Jan 21, 2026
Introduce some builder classes to make creating scalar index easy. For
example.

```java
  ScalarIndexParams params = BTreeIndexParams.builder()
      .zoneSize(2048)
      .build();

  IndexParams indexParams = IndexParams.builder().setScalarIndexParams(scalarParams).build();

   // Create BTree index on 'id' column
   dataset.createIndex(
       Collections.singletonList("id"),
       IndexType.BTREE,
       Optional.of("btree_id_index"),
       indexParams,
       true);
```

---------

Co-authored-by: lijinglun <lijinglun@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants