Skip to content

feat: sync with tantivy-py 0.26.2 - #49

Merged
oxdev03 merged 1 commit into
mainfrom
chore/sync-tantivy-py-upstream
Sep 18, 2026
Merged

oxdev03 merged 1 commit into
mainfrom
chore/sync-tantivy-py-upstream

Conversation

@oxdev03

@oxdev03 oxdev03 commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Update the tantivy-py submodule from 0.24.0-22 to 0.26.2 and port every upstream change back, keeping the file-for-file, method-for-method mapping the port is built on. Bumps tantivy 0.25 -> 0.26.2 and the napi-rs JS toolchain.

Ported APIs:

  • Searcher: orderByField over u64/i64/f64/bool/date/str fast fields, weightByField, cardinality(), fastFieldValues(), termsWithPrefix(); aggregate() now takes and returns objects instead of JSON strings
  • Query: andMustMatch/orShouldMatch/andMustNotMatch with flat chaining, booleanQuery minimumNumberShouldMatch, moreLikeThisDocumentFieldsQuery, unbounded range bounds, useInvertedIndex, offset pairs for phrase words, existsQuery(fastFieldName, jsonSubpaths)
  • Index: isCompatible(), registerFastFieldTokenizer(), conjunctionByDefault and allowRegexes on both parse methods, deleteDocuments alias
  • Module-level parseQuery/parseQueryLenient, addJsonField expandDotsEnabled

Fixes found while aligning:

  • garbageCollectFiles was a silent no-op
  • makeTerm truncated u64 values through get_uint32
  • aggregate coerced its argument to "[object Object]"
  • dates lost sub-second precision
  • a negative value for an unsigned field silently became its absolute value
  • parseQueryLenient returned formatted strings while the 17 error classes it should have returned were exported but unreachable
  • .husky/pre-commit invoked yarn in a pnpm project, so it always failed

Deduplication: one term_from_value instead of two copies of the type match, one more_like_this_builder, get_field instead of four inlined lookups.

FieldType variants now use tantivy-py's names (Text, Unsigned, Integer, Float, Boolean, Json).

Docs: four new tutorial sections, each backed by an executable example.

BREAKING CHANGE: existsQuery drops its schema argument; aggregate takes an object; parseQueryLenient returns error instances rather than strings; phrasePrefixQuery and regexPhraseQuery drop maxExpansions and the two-term minimum; FieldType variants renamed; SearchHit.order widened to number | boolean | string; parser error messages now quote field names with backticks.

Update the tantivy-py submodule from 0.24.0-22 to 0.26.2 and port every
upstream change back, keeping the file-for-file, method-for-method mapping
the port is built on. Bumps tantivy 0.25 -> 0.26.2 and the napi-rs JS
toolchain.

Ported APIs:
- Searcher: orderByField over u64/i64/f64/bool/date/str fast fields,
  weightByField, cardinality(), fastFieldValues(), termsWithPrefix();
  aggregate() now takes and returns objects instead of JSON strings
- Query: andMustMatch/orShouldMatch/andMustNotMatch with flat chaining,
  booleanQuery minimumNumberShouldMatch, moreLikeThisDocumentFieldsQuery,
  unbounded range bounds, useInvertedIndex, offset pairs for phrase words,
  existsQuery(fastFieldName, jsonSubpaths)
- Index: isCompatible(), registerFastFieldTokenizer(), conjunctionByDefault
  and allowRegexes on both parse methods, deleteDocuments alias
- Module-level parseQuery/parseQueryLenient, addJsonField expandDotsEnabled

Fixes found while aligning:
- garbageCollectFiles was a silent no-op
- makeTerm truncated u64 values through get_uint32
- aggregate coerced its argument to "[object Object]"
- dates lost sub-second precision
- a negative value for an unsigned field silently became its absolute value
- parseQueryLenient returned formatted strings while the 17 error classes it
  should have returned were exported but unreachable
- .husky/pre-commit invoked yarn in a pnpm project, so it always failed

Deduplication: one term_from_value instead of two copies of the type match,
one more_like_this_builder, get_field instead of four inlined lookups.

FieldType variants now use tantivy-py's names (Text, Unsigned, Integer,
Float, Boolean, Json).

Docs: four new tutorial sections, each backed by an executable example.

BREAKING CHANGE: existsQuery drops its schema argument; aggregate takes an
object; parseQueryLenient returns error instances rather than strings;
phrasePrefixQuery and regexPhraseQuery drop maxExpansions and the two-term
minimum; FieldType variants renamed; SearchHit.order widened to
number | boolean | string; parser error messages now quote field names with
backticks.
@oxdev03
oxdev03 merged commit 96014e4 into main Sep 18, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant