Skip to content

[fix](be) Score regexp and wildcard patterns with a constant like Elasticsearch - #69815

Merged
airborne12 merged 1 commit into
apache:masterfrom
airborne12:fix-pattern-score-es
Oct 30, 2026
Merged

airborne12 merged 1 commit into
apache:masterfrom
airborne12:fix-pattern-score-es

Conversation

@airborne12

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: None

Related PR: #69052

Problem Summary: score() of pattern queries disagrees with Elasticsearch
and with itself:

-- 'Inverted indexes are suitable for full text search',
-- 'The parser splits text into multiple terms', ...
SELECT score() FROM document WHERE SEARCH('content:/.*ext/');  -- BM25 sum
SELECT score() FROM document WHERE SEARCH('content:*ext');     -- BM25 sum
SELECT score() FROM document WHERE SEARCH('content:te*');      -- 1
SELECT score() FROM document WHERE content MATCH_REGEXP 'ext'; -- 0

Elasticsearch scores a query_string /regexp/, wildcard or prefix, and a
regexp, wildcard or prefix query, with a constant 1 per matching row
(default rewrite constant_score_blended); measured on 9.5.5 with the
rows above: 1.0 for both matching rows. Only an explicit
"rewrite": "scoring_boolean" sums the BM25 of the expanded terms. Next
to a scored clause in a bool must, a regexp adds exactly 1.

#69052 made SEARCH regexp and wildcard sum the BM25 of every expanded
term, i.e. scoring_boolean always on, while prefix stayed constant. That
sum also takes idf and avgdl from the current segment, not from the
tablet statistics MATCH uses: two inserts of the same text scored
0.2876821 and 1.3862942 for identical 'apple' rows, while MATCH 'apple'
scored 0.6931471 for both. MATCH_REGEXP never requested a scoring
context, so it scored 0 like a filter.

Fix:

  1. Revert the scoring part of [fix](be) Score regexp and wildcard search terms with BM25 #69052: ExpandWeight scores every pattern
    with the constant scorer again. The test fixture extensions that
    [fix](be) Support BM25 scoring on keyword SEARCH indexes #69051 built on are kept.
  2. MATCH_REGEXP requests scoring on every index; the regexp expansion
    then publishes the constant 1. The MATCH statistics collector skips
    it, since a constant reads no statistics and the pattern is not text
    to analyze.

Release note

score() of SEARCH regexp and wildcard clauses is a constant 1 per
matching row again, like prefix clauses and Elasticsearch's default.
score() of MATCH_REGEXP is 1 instead of 0.

Check List (For Author)

  • Test: Regression test / Unit Test / Manual test
    • Regression test: new search/test_search_score_pattern_constant
      (V2/V3/SNII, two segments, keyword and analyzed fields; identical
      on all three formats); 24 existing score suites in
      inverted_index_p0, search and variant_p0 pass unchanged
    • Unit Test: 477 tests (IndexReaderHelperTest, CollectionStatistics*,
      regexp/wildcard/prefix engine tests restored by the revert,
      FunctionSearchTest, SNII query tests). Mutation checks: the gate
      test fails without the gate change, the collector test fails
      without the regexp skip
    • Manual test: Elasticsearch 9.5.5 on the same rows for every query
      shape above; two-segment table now scores 1 for every pattern hit
    • Built and run on master 62e3d81 plus this change: the current
      master tip does not compile (function_datasketches_hll.cpp after
      [refine](column) Normalize constant expression results #69679), and none of the files touched here changed in between
  • Behavior changed: Yes. SEARCH regexp/wildcard scores and MATCH_REGEXP
    scores change as described in the release note.
  • Does this need documentation: No

🤖 Generated with Claude Code

…sticsearch

### What problem does this PR solve?

Issue Number: None

Related PR: apache#69052

Problem Summary: score() of pattern queries disagrees with Elasticsearch
and with itself:

    -- 'Inverted indexes are suitable for full text search',
    -- 'The parser splits text into multiple terms', ...
    SELECT score() FROM document WHERE SEARCH('content:/.*ext/');  -- BM25 sum
    SELECT score() FROM document WHERE SEARCH('content:*ext');     -- BM25 sum
    SELECT score() FROM document WHERE SEARCH('content:te*');      -- 1
    SELECT score() FROM document WHERE content MATCH_REGEXP 'ext'; -- 0

Elasticsearch scores a query_string /regexp/, wildcard or prefix, and a
regexp, wildcard or prefix query, with a constant 1 per matching row
(default rewrite constant_score_blended); measured on 9.5.5 with the
rows above: 1.0 for both matching rows. Only an explicit
"rewrite": "scoring_boolean" sums the BM25 of the expanded terms. Next
to a scored clause in a bool must, a regexp adds exactly 1.

apache#69052 made SEARCH regexp and wildcard sum the BM25 of every expanded
term, i.e. scoring_boolean always on, while prefix stayed constant. That
sum also takes idf and avgdl from the current segment, not from the
tablet statistics MATCH uses: two inserts of the same text scored
0.2876821 and 1.3862942 for identical 'apple' rows, while MATCH 'apple'
scored 0.6931471 for both. MATCH_REGEXP never requested a scoring
context, so it scored 0 like a filter.

Fix:
1. Revert the scoring part of apache#69052: ExpandWeight scores every pattern
   with the constant scorer again. The test fixture extensions that
   apache#69051 built on are kept.
2. MATCH_REGEXP requests scoring on every index; the regexp expansion
   then publishes the constant 1. The MATCH statistics collector skips
   it, since a constant reads no statistics and the pattern is not text
   to analyze.

### Release note

score() of SEARCH regexp and wildcard clauses is a constant 1 per
matching row again, like prefix clauses and Elasticsearch's default.
score() of MATCH_REGEXP is 1 instead of 0.

### Check List (For Author)

- Test: Regression test / Unit Test / Manual test
    - Regression test: new search/test_search_score_pattern_constant
      (V2/V3/SNII, two segments, keyword and analyzed fields; identical
      on all three formats); 24 existing score suites in
      inverted_index_p0, search and variant_p0 pass unchanged
    - Unit Test: 477 tests (IndexReaderHelperTest, CollectionStatistics*,
      regexp/wildcard/prefix engine tests restored by the revert,
      FunctionSearchTest, SNII query tests). Mutation checks: the gate
      test fails without the gate change, the collector test fails
      without the regexp skip
    - Manual test: Elasticsearch 9.5.5 on the same rows for every query
      shape above; two-segment table now scores 1 for every pattern hit
    - Built and run on master 62e3d81 plus this change: the current
      master tip does not compile (function_datasketches_hll.cpp after
      apache#69679), and none of the files touched here changed in between
- Behavior changed: Yes. SEARCH regexp/wildcard scores and MATCH_REGEXP
  scores change as described in the release note.
- Does this need documentation: No

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@airborne12

Copy link
Copy Markdown
Member Author

/review

@airborne12
airborne12 marked this pull request as ready for review October 29, 2026 11:58

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Static review of PR #69815 at exact head bdde929 against ee6969e found no blocking or actionable defect.

The requested behavior is implemented coherently: expanded regexp, wildcard, prefix, suffix, and contains leaves enumerate matching terms into a deduplicated row bitmap and publish one constant score per matching row; Boolean AND/OR/MUST_NOT, multi-segment, top-k, nullable, candidate, phrase-prefix fallback, CLucene/V2/V3, and SNII paths preserve the expected score and truth-set composition. MATCH_REGEXP is admitted to score-enabled execution on analyzed and keyword indexes, while statistics collection intentionally skips the raw pattern; score-disabled execution retains the existing listing and cache behavior. No new concurrency, lifecycle, persistence, protocol, configuration, memory-accounting, or error-propagation risk was found.

The changed unit tests and the new regression suite cover the intended constant-score behavior across V2, V3, and SNII, analyzed and keyword fields, two segments, direct MATCH_REGEXP, mixed MATCH plus regexp scoring, and equality baselines. Existing inline review threads are empty and there is no additional user focus. This was a static-only review; no builds or tests were run.

Review converged after 1 round(s).

@airborne12

Copy link
Copy Markdown
Member Author

run external

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28387 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit bdde929a6c1f3dc9a18fed8da3e90429afc40da3, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17605	5182	5061	5061
q2	2150	287	278	278
q3	10227	1358	816	816
q4	4679	457	333	333
q5	7446	802	531	531
q6	181	186	153	153
q7	742	788	601	601
q8	9250	1336	1011	1011
q9	5647	4195	4402	4195
q10	6807	1297	1042	1042
q11	422	247	226	226
q12	639	401	281	281
q13	18071	3554	3024	3024
q14	269	266	243	243
q15	q16	704	716	664	664
q17	1200	749	592	592
q18	7012	6191	6124	6124
q19	1115	971	596	596
q20	371	331	223	223
q21	4869	2139	2273	2139
q22	340	289	254	254
Total cold run time: 99746 ms
Total hot run time: 28387 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5587	5612	5608	5608
q2	683	560	536	536
q3	5204	5451	4942	4942
q4	1978	2134	1571	1571
q5	5253	5176	5611	5176
q6	252	204	161	161
q7	2339	2053	1869	1869
q8	3051	2662	2704	2662
q9	8018	8001	7929	7929
q10	3807	3703	3232	3232
q11	638	447	423	423
q12	725	717	529	529
q13	3489	3828	3331	3331
q14	305	331	289	289
q15	q16	705	715	626	626
q17	8169	7060	6778	6778
q18	13058	12178	12912	12178
q19	912	779	805	779
q20	2118	2155	1905	1905
q21	5678	4704	4748	4704
q22	487	456	425	425
Total cold run time: 72456 ms
Total hot run time: 65653 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 151178 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit bdde929a6c1f3dc9a18fed8da3e90429afc40da3, data reload: false

query5	4306	583	453	453
query6	425	200	186	186
query7	4806	443	227	227
query8	326	171	153	153
query9	8764	3254	3245	3245
query10	468	309	254	254
query11	5933	3871	3586	3586
query12	157	99	86	86
query13	1241	444	335	335
query14	6130	3962	3670	3670
query14_1	3425	3418	3441	3418
query15	213	193	186	186
query16	948	447	408	408
query17	869	651	541	541
query18	2442	430	318	318
query19	200	170	143	143
query20	87	85	84	84
query21	211	128	110	110
query22	12953	12962	12834	12834
query23	13531	13055	12535	12535
query23_1	12659	12558	12890	12558
query24	7377	853	476	476
query24_1	488	493	494	493
query25	532	422	360	360
query26	1256	261	147	147
query27	2768	446	277	277
query28	4583	2042	2036	2036
query29	1600	601	456	456
query30	296	225	175	175
query31	1008	928	816	816
query32	155	92	94	92
query33	529	307	246	246
query34	898	863	513	513
query35	749	775	663	663
query36	850	800	710	710
query37	130	102	85	85
query38	1774	1755	1707	1707
query39	822	807	762	762
query39_1	738	727	741	727
query40	248	127	101	101
query41	71	67	69	67
query42	91	87	93	87
query43	351	372	317	317
query44	1394	752	734	734
query45	181	182	171	171
query46	852	997	587	587
query47	2978	3014	2653	2653
query48	308	313	224	224
query49	568	400	299	299
query50	720	295	233	233
query51	10536	10483	10249	10249
query52	78	80	68	68
query53	196	215	163	163
query54	238	196	174	174
query55	71	64	64	64
query56	248	208	215	208
query57	1647	1648	1570	1570
query58	282	273	257	257
query59	2162	2104	1946	1946
query60	300	241	225	225
query61	152	147	148	147
query62	389	327	279	279
query63	187	159	161	159
query64	2743	938	756	756
query65	3338	3251	3251	3251
query66	1786	421	304	304
query67	20113	20127	19724	19724
query68	2971	1018	635	635
query69	388	291	254	254
query70	887	786	805	786
query71	306	240	214	214
query72	2738	2547	2276	2276
query73	516	527	300	300
query74	4637	4524	4368	4368
query75	2351	2289	1910	1910
query76	2322	1019	595	595
query77	346	372	281	281
query78	9876	9724	9184	9184
query79	1028	857	538	538
query80	1229	426	351	351
query81	593	322	277	277
query82	606	133	104	104
query83	306	199	181	181
query84	317	125	100	100
query85	855	433	382	382
query86	397	238	235	235
query87	1995	1938	1802	1802
query88	3853	2790	2780	2780
query89	329	284	245	245
query90	1947	168	170	168
query91	157	156	129	129
query92	89	89	89	89
query93	1071	1010	583	583
query94	639	295	283	283
query95	583	326	316	316
query96	687	501	238	238
query97	2497	2460	2300	2300
query98	160	158	152	152
query99	769	754	644	644
Total cold run time: 236012 ms
Total hot run time: 151178 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 24.3 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit bdde929a6c1f3dc9a18fed8da3e90429afc40da3, data reload: false

query1	0.00	0.00	0.00
query2	0.10	0.05	0.04
query3	0.26	0.09	0.08
query4	1.62	0.10	0.10
query5	0.24	0.23	0.24
query6	1.17	0.69	0.67
query7	0.04	0.00	0.01
query8	0.06	0.04	0.03
query9	0.40	0.35	0.34
query10	0.56	0.57	0.58
query11	0.20	0.14	0.14
query12	0.18	0.15	0.15
query13	0.48	0.48	0.49
query14	1.04	1.01	1.03
query15	0.63	0.60	0.59
query16	0.31	0.34	0.34
query17	1.16	1.11	1.16
query18	0.21	0.20	0.19
query19	2.14	2.05	1.97
query20	0.02	0.01	0.02
query21	15.49	0.19	0.14
query22	4.96	0.05	0.05
query23	16.28	0.30	0.13
query24	3.16	0.50	0.51
query25	0.13	0.08	0.04
query26	1.19	0.21	0.14
query27	0.06	0.04	0.05
query28	3.99	0.75	0.34
query29	12.48	4.15	3.33
query30	0.29	0.13	0.09
query31	2.77	0.54	0.32
query32	3.23	0.60	0.49
query33	3.24	3.14	3.25
query34	15.33	4.01	3.39
query35	3.36	3.33	3.32
query36	0.56	0.43	0.43
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.16	0.14
query41	0.10	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 97.87 s
Total hot run time: 24.3 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.55% (36392/46927)
Line Coverage 62.84% (411498/654885)
Region Coverage 59.32% (348573/587623)
Branch Coverage 60.20% (161533/268335)

@airborne12
airborne12 merged commit 6991e76 into apache:master Oct 30, 2026
43 checks passed
@airborne12
airborne12 deleted the fix-pattern-score-es branch October 30, 2026 01:27
yiguolei pushed a commit that referenced this pull request Oct 30, 2026
…ant like Elasticsearch (#69825)

### What problem does this PR solve?

Issue Number: None

Related PR: #69815, #69269

Problem Summary: score() of pattern queries disagrees with Elasticsearch
and with itself on branch-4.1:

    -- 'Inverted indexes are suitable for full text search',
    -- 'The parser splits text into multiple terms', ...
SELECT score() FROM document WHERE SEARCH('content:/.*ext/'); -- BM25
sum
SELECT score() FROM document WHERE SEARCH('content:*ext'); -- BM25 sum
    SELECT score() FROM document WHERE content MATCH_REGEXP 'ext'; -- 0

Elasticsearch scores a query_string /regexp/, wildcard or prefix, and a
regexp, wildcard or prefix query, with a constant 1 per matching row
(default rewrite constant_score_blended); measured on 9.5.5 with the
rows above: 1.0 for both matching rows. Only an explicit
"rewrite": "scoring_boolean" sums the BM25 of the expanded terms. Next
to a scored clause in a bool must, a regexp adds exactly 1.

#69269 (the branch-4.1 pick of #69052) made SEARCH regexp and wildcard
sum the BM25 of every expanded term, i.e. scoring_boolean always on,
with idf and avgdl taken from the current segment rather than the tablet
statistics MATCH uses, so identical rows in two segments scored
differently. MATCH_REGEXP never requested a scoring context, so it
scored 0 like a filter.

Fix, the same as #69815 on master:
1. Revert #69269: RegexpWeight scores every pattern with the constant
   scorer again; its suite that pinned the BM25 sums is removed.
2. MATCH_REGEXP requests scoring on every index, and the legacy
   RegexpQuery records 1 for every matching row when score() is
   requested. The MATCH statistics collector skips it, since a constant
   reads no statistics and the pattern is not text to analyze.

A MATCH_REGEXP on a keyword (untokenized) index also scores 1 once the
keyword reader requests scoring (#69791); until then it keeps 0.

### Release note

score() of SEARCH regexp and wildcard clauses is a constant 1 per
matching row again, like prefix clauses and Elasticsearch's default.
score() of MATCH_REGEXP on a tokenized index is 1 instead of 0.

### Check List (For Author)

- Test: Regression test / Unit Test / Manual test
    - Regression test: new search/test_search_score_pattern_constant
      (V2/V3, two segments); all 18 blocks equal the master PR's V2/V3
      blocks; 16 existing score suites in inverted_index_p0 and search
      pass unchanged
- Unit Test: 130 tests (IndexReaderHelperTest, CollectionStatistics*,
      RegexpQueryTest and the query_v2 regexp/wildcard tests restored by
      the revert)
    - Manual test: Elasticsearch 9.5.5 on the same rows; a two-segment
table now scores 1 for every pattern hit on a branch-4.1 ASAN build
- Behavior changed: Yes. SEARCH regexp/wildcard scores and MATCH_REGEXP
  scores change as described in the release note.
- Does this need documentation: No


🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot pushed a commit that referenced this pull request Nov 1, 2026
…sticsearch (#69815)

### What problem does this PR solve?

Issue Number: None

Related PR: #69052

Problem Summary: score() of pattern queries disagrees with Elasticsearch
and with itself:

    -- 'Inverted indexes are suitable for full text search',
    -- 'The parser splits text into multiple terms', ...
SELECT score() FROM document WHERE SEARCH('content:/.*ext/'); -- BM25
sum
SELECT score() FROM document WHERE SEARCH('content:*ext'); -- BM25 sum
    SELECT score() FROM document WHERE SEARCH('content:te*');      -- 1
    SELECT score() FROM document WHERE content MATCH_REGEXP 'ext'; -- 0

Elasticsearch scores a query_string /regexp/, wildcard or prefix, and a
regexp, wildcard or prefix query, with a constant 1 per matching row
(default rewrite constant_score_blended); measured on 9.5.5 with the
rows above: 1.0 for both matching rows. Only an explicit
"rewrite": "scoring_boolean" sums the BM25 of the expanded terms. Next
to a scored clause in a bool must, a regexp adds exactly 1.

#69052 made SEARCH regexp and wildcard sum the BM25 of every expanded
term, i.e. scoring_boolean always on, while prefix stayed constant. That
sum also takes idf and avgdl from the current segment, not from the
tablet statistics MATCH uses: two inserts of the same text scored
0.2876821 and 1.3862942 for identical 'apple' rows, while MATCH 'apple'
scored 0.6931471 for both. MATCH_REGEXP never requested a scoring
context, so it scored 0 like a filter.

Fix:
1. Revert the scoring part of #69052: ExpandWeight scores every pattern
   with the constant scorer again. The test fixture extensions that
   #69051 built on are kept.
2. MATCH_REGEXP requests scoring on every index; the regexp expansion
   then publishes the constant 1. The MATCH statistics collector skips
   it, since a constant reads no statistics and the pattern is not text
   to analyze.
yiguolei pushed a commit that referenced this pull request Nov 2, 2026
…ant like Elasticsearch #69815 (#69922)

Cherry-picked from #69815

Co-authored-by: Jack <jiangkai@selectdb.com>
yiguolei pushed a commit that referenced this pull request Nov 5, 2026
…ARCH #69790 (#70008)

Backport of #69790 to branch-4.2.

### What problem does this PR solve?

Issue Number: None

Related PR: #69790, #69051

Problem Summary: score() of a MATCH on an untokenized (keyword) inverted
index is always 0, while SEARCH on the same field scores BM25:

    INDEX idx_redirect (redirect) USING INVERTED
    -- one row ('BP')
    SELECT score() FROM t WHERE redirect MATCH 'BP';  -- 0
    SELECT score() FROM t WHERE SEARCH('redirect:BP'); -- 0.2876821

Elasticsearch scores match, term and match_phrase on a keyword field
with BM25 in query context, so the score is the idf of the whole value.
#69051 (already on 4.2) made the engine score keyword postings but kept
MATCH out. This makes a keyword index eligible for MATCH scoring and
collects its whole value as one term, the one the reader looks up. It
also carries the follow-up fixes from #69790's review:
- A keyword MATCH_PHRASE drops its ` ~N` slop before collecting.
- A MATCH on a non-string leaf such as `CAST(n AS STRING)` collects
nothing.
- A VARIANT path that a segment indexed as BKD, or does not hold, adds
no statistics. This covers the BKD searcher coming from the searcher
cache, and SNII.
- A SNII index kind is looked up without copying the directory.

### Branch adaptations

- `can_score_match` keeps 4.2's analyzed rule (support_phrase only);
branch-4.2 has no lowercase-normalizer clause.
- `test_omit_norms` does not exist on 4.2, so its `.out` change is
dropped. The branch was cut before #69922 (the 4.2 backport of #69815)
and then merged with branch-4.2 to resolve its conflict in
`index_reader_helper_test.cpp`: both tests are kept, as on master.
- `test_match_keyword_score` inserts its VARIANT rows as JSON strings:
`parse_to_variant` in `VALUES` fails on 4.2 with a max-subcolumns
conversion error. The expected output is master's file, unchanged.
- **#69901 (BM25 statistics per index) is not on 4.2.** A MATCH on a
keyword index and a MATCH on an analyzed index of the same column in one
`score()` query (`name MATCH 'apple' USING ANALYZER english AND name
MATCH 'apple' USING ANALYZER none`) now fails with "Scoring predicates
for one field select different inverted indexes". Master behaved the
same before #69901. Before this change, that query ran with the keyword
clause scoring 0. Each clause alone scores fine. Two analyzed indexes on
one column already fail this way on 4.2. Backporting #69901 lifts this.

### Validation

On this branch merged with branch-4.2 c2aaed9, ASAN build:
- BE UT: 1611 tests in `IndexReaderHelperTest`, `CollectionStatistics*`
and `*Snii*` pass.
- Regression: `test_match_keyword_score` passes against master's `.out`
on V2/V3/SNII. The following also pass:
`test_match_phrase_prefix_score`, `test_bm25_score`,
`test_score_filter_matrix`, `test_score_filter_usage`,
`test_search_score_topn_predicates`, `test_multi_analyzer_query`,
`test_match_using_analyzer`, `test_single_column_multi_index` (with
debug points on), `test_search_score_keyword_filters`,
`test_search_score_raw_index`, `test_search_score_pattern_constant`.
- Local note: the local thirdparty predates the lance-c upgrade, so
`lance_reader.cpp`'s `lance_scanner_set_scalar_index_auto_selection`
call was stubbed for the local build only. It is not part of this PR.

### Release note

score() of MATCH / MATCH_ALL / MATCH_PHRASE on a keyword (untokenized)
inverted index now returns the BM25 score of the value, the same as
SEARCH, instead of 0.

### Check List (For Author)

- Test: Regression test / Unit Test (see Validation)
- Behavior changed: Yes. Keyword MATCH contributes its BM25 score to
score() instead of 0.
- Does this need documentation: No

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants