Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Semantic text query #1

Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
320 commits
Select commit Hold shift + click to select a range
20932c6
[Automated] Update Lucene snapshot to 9.10.0-snapshot-af7b6ef53d3
elasticsearchmachine Jan 8, 2024
50ad0d6
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 8, 2024
9c964dd
[Automated] Update Lucene snapshot to 9.10.0-snapshot-8e8fdea7d23
elasticsearchmachine Jan 9, 2024
5e80ba5
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 9, 2024
ea0bfb2
[Automated] Update Lucene snapshot to 9.10.0-snapshot-ad525056591
elasticsearchmachine Jan 10, 2024
83d4835
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 10, 2024
63e46cc
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 11, 2024
8916e82
[Automated] Update Lucene snapshot to 9.10.0-snapshot-7ad2507c2e5
elasticsearchmachine Jan 12, 2024
562027d
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 12, 2024
a4c0fc0
[Automated] Update Lucene snapshot to 9.10.0-snapshot-fb3bcc0f61e
elasticsearchmachine Jan 13, 2024
79487c2
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 13, 2024
271e0e2
[Automated] Update Lucene snapshot to 9.10.0-snapshot-fb3bcc0f61e
elasticsearchmachine Jan 14, 2024
fb5a913
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 14, 2024
86adada
[Automated] Update Lucene snapshot to 9.10.0-snapshot-a457b5fd5fc
elasticsearchmachine Jan 15, 2024
ad5478c
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 15, 2024
13edac3
[Automated] Update Lucene snapshot to 9.10.0-snapshot-f3d625ea06c
elasticsearchmachine Jan 16, 2024
e3a7590
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 16, 2024
daaf34b
[Automated] Update Lucene snapshot to 9.10.0-snapshot-00e2fe6cacb
elasticsearchmachine Jan 17, 2024
8750cd4
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 17, 2024
f4b6440
[Automated] Update Lucene snapshot to 9.10.0-snapshot-564219a65a9
elasticsearchmachine Jan 18, 2024
288592c
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 18, 2024
b57dbe0
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 19, 2024
3b6e850
[Automated] Update Lucene snapshot to 9.10.0-snapshot-c8980471e12
elasticsearchmachine Jan 20, 2024
a24d121
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 20, 2024
207a8fd
[Automated] Update Lucene snapshot to 9.10.0-snapshot-c8980471e12
elasticsearchmachine Jan 21, 2024
b3e04a8
[Automated] Update Lucene snapshot to 9.10.0-snapshot-c8980471e12
elasticsearchmachine Jan 22, 2024
d000196
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 22, 2024
46eb1ee
[Automated] Update Lucene snapshot to 9.10.0-snapshot-b951c4c0611
elasticsearchmachine Jan 23, 2024
f135d5e
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 23, 2024
ae600d9
[Automated] Update Lucene snapshot to 9.10.0-snapshot-9ccfc30ddcb
elasticsearchmachine Jan 24, 2024
922d479
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 24, 2024
a662e09
[Automated] Update Lucene snapshot to 9.10.0-snapshot-aabee01500d
elasticsearchmachine Jan 25, 2024
e25267f
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 25, 2024
c4651d3
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 26, 2024
647005f
Fix compilation for new lucene snapshot and FieldInfo ctor (#104818)
benwtrent Jan 26, 2024
b7476f5
[Automated] Update Lucene snapshot to 9.10.0-snapshot-42d5806fd69
elasticsearchmachine Jan 27, 2024
d7ea7ae
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 27, 2024
42cad64
[Automated] Update Lucene snapshot to 9.10.0-snapshot-42d5806fd69
elasticsearchmachine Jan 28, 2024
99e4fce
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 28, 2024
b9418bd
[Automated] Update Lucene snapshot to 9.10.0-snapshot-42d5806fd69
elasticsearchmachine Jan 29, 2024
12d7728
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 29, 2024
f4f8414
[Automated] Update Lucene snapshot to 9.10.0-snapshot-deac9c26512
elasticsearchmachine Jan 30, 2024
7486dc4
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Jan 30, 2024
e1b74aa
[Automated] Update Lucene snapshot to 9.10.0-snapshot-1e36b461474
elasticsearchmachine Jan 31, 2024
47ca7ae
Update/main (#104974)
benwtrent Jan 31, 2024
2846aa7
[Automated] Update Lucene snapshot to 9.10.0-snapshot-3d8ad990397
elasticsearchmachine Feb 1, 2024
9a7de59
[Automated] Update Lucene snapshot to 9.10.0-snapshot-4e73a4b2aca
elasticsearchmachine Feb 2, 2024
38709e2
[Automated] Update Lucene snapshot to 9.10.0-snapshot-70bab56f6fe
elasticsearchmachine Feb 3, 2024
6deb746
[Automated] Update Lucene snapshot to 9.10.0-snapshot-70bab56f6fe
elasticsearchmachine Feb 4, 2024
f121372
[Automated] Update Lucene snapshot to 9.10.0-snapshot-3da32a257be
elasticsearchmachine Feb 5, 2024
c572ca1
[Automated] Update Lucene snapshot to 9.10.0-snapshot-c4df3e13ad8
elasticsearchmachine Feb 6, 2024
a923934
Merge remote-tracking branch 'upstream/main' into lucene_snapshot
benwtrent Feb 6, 2024
e562d3b
[Automated] Update Lucene snapshot to 9.10.0-snapshot-c4df3e13ad8
elasticsearchmachine Feb 7, 2024
e4e63f8
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Feb 7, 2024
e6f2e70
Fix compile failure
javanna Feb 7, 2024
4661023
[Automated] Update Lucene snapshot to 9.10.0-snapshot-f3e2929a52c
elasticsearchmachine Feb 8, 2024
ad2b95e
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Feb 8, 2024
739072c
Fix compilation for ESKnnQuery objects (#105302)
benwtrent Feb 8, 2024
844e75f
[Automated] Update Lucene snapshot to 9.10.0-snapshot-06ee710c3c4
elasticsearchmachine Feb 9, 2024
69c674e
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Feb 9, 2024
8c911a1
Added skeleton code for SemanticQueryBuilder
Mikep86 Feb 9, 2024
95c42fb
Add boost and query name to XContent
Mikep86 Feb 9, 2024
03fe8c0
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Feb 10, 2024
1be3e9a
[Automated] Update Lucene snapshot to 9.10.0-snapshot-f4dbab4e10e
elasticsearchmachine Feb 11, 2024
0315982
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Feb 11, 2024
42b6585
[Automated] Update Lucene snapshot to 9.10.0-snapshot-695c0ac8450
elasticsearchmachine Feb 12, 2024
6d70cbc
Merge remote-tracking branch 'origin/main' into lucene_snapshot
elasticsearchmachine Feb 12, 2024
84dd66c
Merge branch 'main' into lucene_snapshot_9_10
jpountz Feb 15, 2024
a55ce08
Move to final 9.10.0 artifacts.
jpountz Feb 15, 2024
a04712b
Update docs/changelog/105578.yaml
jpountz Feb 15, 2024
950d46a
Fix compilation.
jpountz Feb 15, 2024
98ceb06
Remove temporary repository, go to Maven central instead.
jpountz Feb 20, 2024
b8dc5c3
Fix for SearchServiceTests#testWaitOnRefreshFailsIfCheckpointNotIndex…
pmpailis Feb 20, 2024
410efb6
Fixing NPE when requesting [_none_] for stored_fields (#104711)
pmpailis Feb 20, 2024
7fb4b74
[Transform] Test waits for next iteration (#105560)
prwhelan Feb 20, 2024
0d0b319
Fixing compilation error in SearchSourceBuilderTests#testStoredFields…
pmpailis Feb 20, 2024
5920c91
Encapsulate Mapper.Builder#name and make it private (#105648)
felixbarny Feb 20, 2024
2dc9e89
Make name getter method in Mapper.Builder final (#105661)
javanna Feb 20, 2024
ac08fe6
Fix HTTP corner-case response leaks (#105617)
DaveCTurner Feb 20, 2024
f4702fa
Fix dynamic mapping condition when create tsid (#105636)
dnhatn Feb 20, 2024
065158e
Expose owner realm_type in the returned API key information (#105629)
albertzaharovits Feb 20, 2024
b3fc714
Painless: Apply true regex limit factor with FIND and MATCH operator …
stu-elastic Feb 20, 2024
35df385
[Transform] Fix testStopAtCheckpoint (#105664)
prwhelan Feb 20, 2024
991c21f
Merge branch 'carlosdelest/semantic-text-dense-vector-support' into s…
Mikep86 Feb 20, 2024
3870bc8
Added modelsForFields to QueryRewriteContext
Mikep86 Feb 20, 2024
fa67339
Updated IndicesService to create the modelsForFields map
Mikep86 Feb 20, 2024
f65f8ec
Remove unused field (#105640)
idegtiarenko Feb 21, 2024
4c21c96
Set disk watermarks to low values to prevent tests from failing on no…
ldematte Feb 21, 2024
3cde13c
Distinguish different snapshot failures by log level (#105622)
DaveCTurner Feb 21, 2024
7cbdb6c
Drop dead code from get-snapshots request & response (#105608)
DaveCTurner Feb 21, 2024
f06a580
ES|QL: Set default query LIMIT to 1000 (#105618)
luigidellaquila Feb 21, 2024
16bdbe4
Remove needless allocations of ReducedRequestInfo from TransportBulkA…
original-brownbear Feb 21, 2024
954c428
Fix EsAbortPolicy to not force execution if executor is already shutt…
mosche Feb 21, 2024
0dca71e
Avoid allocations in security's Automaton cache (#105654)
original-brownbear Feb 21, 2024
d1ec0d2
Add protected method to allow overriding the computation of the size …
tlrx Feb 21, 2024
76cf927
Fix Setting.exists if key doesn't equal key in settings keys. (#105652)
mosche Feb 21, 2024
550b5bb
[Connectors API] Unify enum error messages and add more tests (#105569)
timgrein Feb 21, 2024
5d4bb6e
Slight readability improvement in EsAbortPolicy (#105680)
DaveCTurner Feb 21, 2024
48ceed0
Additional roles and privileges APIs customization (#105503)
n1v0lg Feb 21, 2024
d4263c2
Accept `SocketException` in `Netty4HttpClient` (#105690)
DaveCTurner Feb 21, 2024
9c72157
Add dense vector inference mock service for testing (#105655)
carlosdelest Feb 21, 2024
ffa4d40
Merge remote-tracking branch 'origin/main' into feature/semantic-text
carlosdelest Feb 21, 2024
1f1636e
Fix error 500 on invalid ParentIdQuery (#105693)
original-brownbear Feb 21, 2024
d693fc8
Fix search response leaks in async search tests (#105675)
original-brownbear Feb 21, 2024
2d4a49a
[DOCS] Fixes get settings and update settings security API docs (#105…
szabosteve Feb 21, 2024
edf96a5
Add RCS1.0 security test for the ResolveCluster API (#105524)
quux00 Feb 21, 2024
5f508a1
Fix transport bug handling errors in rule query (#105667)
kderusso Feb 21, 2024
86f4b18
Reduce InternalGeoGrid in a streaming fashion (#105651)
iverase Feb 21, 2024
0da5220
Call real memory circuit breaker in BucketsAggregator#collectBucket i…
iverase Feb 21, 2024
280fa40
Improve EarlyDeprecationindexingIT test reliability (#105696)
pgomulka Feb 21, 2024
6b50b6d
Block updates to log level for restricted loggers if less specific th…
mosche Feb 21, 2024
80dae50
Optimized readString for StreamInputs operating on arrays to minimize…
mosche Feb 21, 2024
ce8402f
[ML] Make regex more efficient (#105705)
droberts195 Feb 21, 2024
31f9b71
Updated SemanticQueryBuilder to implement doRewrite
Mikep86 Feb 21, 2024
a9f4b64
Delegate readString in FilterStreamInput to possibly use an optimized…
mosche Feb 21, 2024
fb7b1bc
Merge branch 'main' into lucene_snapshot_9_10
elasticmachine Feb 21, 2024
40af275
updating release notes
benwtrent Feb 21, 2024
011693a
Added semanticQuery to SemanticTextFieldMapper
Mikep86 Feb 21, 2024
c53a8e1
Updated SemanticQueryBuilder to implement doToQuery
Mikep86 Feb 21, 2024
4da7a12
Updated SemanticQueryBuilder to add fromXContent
Mikep86 Feb 21, 2024
3a1d7e3
Added SemanticQueryBuilder to inference plugin
Mikep86 Feb 21, 2024
be55e4b
Use Lucene queries to build semantic query
Mikep86 Feb 21, 2024
b1fcedd
Fix `uri_parts` processor behaviour for missing extensions (#105689)
nielsbauman Feb 22, 2024
50c1dcb
Small improvements to test-only `Netty4HttpClient` (#105694)
DaveCTurner Feb 22, 2024
09bdb16
Support chunked bulk loading of larger data files in CSV tests (#105701)
craigtaverner Feb 22, 2024
d842ce9
Remove control-flow exception in `Netty4HttpPipeliningHandler#write` …
DaveCTurner Feb 22, 2024
c8a35d3
`IndexShardRoutingTable` should always be nonempty (#105720)
DaveCTurner Feb 22, 2024
dee0be5
Flatten object mappings when subobjects is false (#103542)
felixbarny Feb 22, 2024
d26214f
[Connectors API] Extend tests for update connector filtering (#105697)
timgrein Feb 22, 2024
d7fbabc
Consistently use `PATH_RESTRICTED` (#105630)
n1v0lg Feb 22, 2024
a9783c4
[DOCS] Updates the list of community contributed clients. (#105623)
szabosteve Feb 22, 2024
268ba12
[ML] Fix AutodetectMemoryLimitIT.testManyDistinctOverFields (#105727)
droberts195 Feb 22, 2024
8daa5eb
[ML] Unmute model deployment BWC tests (#105728)
droberts195 Feb 22, 2024
c998970
HNWS -> HNSW
jpountz Feb 22, 2024
d046a5c
[Connectors Secrets API] Add missing public method docs (#105737)
timgrein Feb 22, 2024
98a7ca5
[ML] Unmute KDETests.testCdfAndSf (#105735)
droberts195 Feb 22, 2024
6073e74
[DOCS] Adds more detail on disk usage of kNN quantized vectors (#105724)
szabosteve Feb 22, 2024
b650051
Update PersistentTasksService start/stop methods with optional par… (…
volodk85 Feb 22, 2024
c5b705d
Refactor `node_selector`s: remove redundant ones and change to `curre…
ldematte Feb 22, 2024
f396321
Reduce InternalAutoDateHistogram in a streaming fashion (#105740)
iverase Feb 22, 2024
b2d25b7
Removing set once within services (#105713)
jonathan-buttner Feb 22, 2024
5b82681
Upgrade jna to 5.12.1 (#105717)
rjernst Feb 22, 2024
39dd09b
Grow buckets on FilterByFilterAggregator eagerly (#105703)
iverase Feb 22, 2024
b752169
Use hamcrest regex matcher rather than our own (#104457)
thecoop Feb 22, 2024
1cfa86e
[DOCS] Update anomaly detection jobs health rule details (#105716)
lcawl Feb 22, 2024
a13f52f
be code compatible with serverless (#105746)
volodk85 Feb 22, 2024
dbf72e1
Reduce InternalVariableWidthHistogram in a streaming fashion (#105748)
iverase Feb 22, 2024
c60706c
Forward port release notes for v8.12.2 (#105752)
elasticsearchmachine Feb 22, 2024
ad65def
Bump versions after 8.12.2 release
elasticsearchmachine Feb 22, 2024
8fd6e30
Prune changelogs after 8.12.2 release
elasticsearchmachine Feb 22, 2024
89c61cd
Fix noisy logging from HealthNodeTaskExecutor (#105695)
original-brownbear Feb 22, 2024
8090c61
PainlessExecute RCS2 test fails on assert in AuthorizationDenialMessa…
quux00 Feb 22, 2024
f0e4317
[ML] Fix DataFrameAnalyticsConfigProviderIT.testUpdate_UpdateCannotBe…
droberts195 Feb 22, 2024
92c2b36
Decouple enrollment token version from node version (#104018)
gwbrown Feb 23, 2024
b95cb8c
Introduce `TransportGetSnapshotsAction#GetSnapshotsOperation` (#105609)
DaveCTurner Feb 23, 2024
2ba37ff
Reduce InternalAdjacencyMatrix in a streaming fashion (#105751)
iverase Feb 23, 2024
ae4e57d
[Connectors API] Add tests for ConnectorStateMachine (#105736)
timgrein Feb 23, 2024
5671669
[Connectors API] Remove unused method (#105739)
timgrein Feb 23, 2024
21b64ba
[Connectors API] Make default scheduling for all sync jobs more reada…
timgrein Feb 23, 2024
10ec23a
Add metrics for retries by S3RetryingInputStream (#105600)
ywangd Feb 23, 2024
d67af19
Enhance LeakTracker to record thread + test that caused a leak (#105758)
original-brownbear Feb 23, 2024
39a4ddb
email-reporting-attachment-docs: Correct auth and proxy fields. (#105…
alstolten Feb 23, 2024
1dd2712
Add new shard_seed parameter for random_sampler agg (#104830)
benwtrent Feb 23, 2024
d37d93a
[Docs] [Remote Clusters] Note about certificates in ESS for Remote Cl…
florent-leborgne Feb 23, 2024
f86532b
[Transform] Retry destination index creation (#105759)
prwhelan Feb 23, 2024
e568f70
[ci] Attach correct build artifact link to build scan when multiple a…
brianseeders Feb 23, 2024
93988f9
Merge branch 'main' into lucene_snapshot_9_10
elasticmachine Feb 23, 2024
e0d2616
CCS with minimize_roundtrips performs incremental merges of each Sear…
quux00 Feb 23, 2024
3b2b9b3
Assert that CacheFile does not read beyond file length (#105749)
tlrx Feb 23, 2024
bc47d18
Convert uses of map/set creation using a subclass to static creation …
thecoop Feb 23, 2024
2e9e8f8
Display error for text_expansion if the queried field does not have t…
saikatsarkar056 Feb 23, 2024
229dba3
[Transform] Clarify transform error message about needing the remote …
TomonoriSoejima Feb 23, 2024
bc2a77f
[TEST] Issue another cluster state change to make sure ILM notices an…
andreidan Feb 23, 2024
528f194
Merge branch 'main' into lucene_snapshot_9_10
elasticmachine Feb 23, 2024
35b2dbe
Field-caps field has value lookup use map instead of looping array (#…
piergm Feb 23, 2024
138bc6a
Speedup FieldCapabilitiesFetcher a little more (#105777)
original-brownbear Feb 23, 2024
4b8b09f
Muting test for issue #105794 (#105795)
benwtrent Feb 23, 2024
5f3e4ae
ESQL: push down "[text_field] is not null" and "[text_field] is null"…
astefan Feb 24, 2024
50090f1
Simplify LeakTracker by using java.lang.ref.Cleaner (#105798)
original-brownbear Feb 24, 2024
2c0d472
Merge branch 'main' into lucene_snapshot_9_10
elasticmachine Feb 24, 2024
3587bc8
[ML] Rename the internal text embedding service to elasticsearch (#10…
davidkyle Feb 25, 2024
d507072
ESQL: Fix wrong attribute shadowing in pushdown rules (#105650)
alex-spies Feb 26, 2024
acfb500
Mute HeapAttackIT
rjernst Feb 26, 2024
5d0296a
Add reference docs links when jna fails to load (#105812)
rjernst Feb 26, 2024
b4b32aa
Fix spotless - silly imports
rjernst Feb 26, 2024
8df3a30
adding field data test (#105523)
forjonathanwilsonyahoocom Feb 27, 2024
e390edb
ESQL: Add timers to many status results (#105421)
nik9000 Feb 27, 2024
73a170b
ESQL: Use faster field caps (#105067)
nik9000 Feb 27, 2024
1df32c9
Mute failing tests from #105837 (#105838)
craigtaverner Feb 28, 2024
136b1a1
[test] Run cluster explanation if can't relocate a shard from a node …
arteam Feb 28, 2024
067aba9
Standardize build distribution internals on os/architecture (#105842)
rjernst Feb 28, 2024
0fb3a6e
Cleanup logic around ML's ScrollDataExtractor and reactivate related …
original-brownbear Feb 28, 2024
4bea4a7
[Docs] Tiny format fix (#105820)
leemthompo Feb 29, 2024
52b027e
[DOCS] Fix bullet in get-desired-balance ref (#105819)
leemthompo Feb 29, 2024
6bb6cab
Stop allocating/acquiring pages redundantly in RecyclerBytesStreamOut…
original-brownbear Mar 1, 2024
07ae23a
Document 429 handling generically (#105700)
henningandersen Mar 1, 2024
0a7c88c
Update Gradle Enterprise plugin to 3.16.2 (#105871)
breskeby Mar 1, 2024
8cc438e
(+DOC)(ILM) Shrink recovers to specific node (#105872)
stefnestor Mar 1, 2024
5d809f3
ProjectOperator should not retain references to released blocks (#105…
dnhatn Mar 3, 2024
c888d39
AwaitsFix for #105890
DaveCTurner Mar 3, 2024
5d1d75a
Avoid eager loading Netty classes in Netty4Plugin (#105889)
original-brownbear Mar 3, 2024
416de3c
Fix testTimeoutRejectionBehaviourAtSubmission (#105891)
DaveCTurner Mar 4, 2024
42786aa
Reduce copying in `GetSnapshotsOperation#snapshots()` (#105765)
DaveCTurner Mar 4, 2024
1978b1f
Cache set of metric names in NodesInfoMetrics (#105888)
original-brownbear Mar 4, 2024
987b778
Extract cold(ish) paths in some SearchPhases (#105884)
original-brownbear Mar 4, 2024
b37e6e9
[Connectors API] Guard cancel and update error sync job endpoints wit…
timgrein Mar 4, 2024
0b664dd
Update README.asciidoc (#103597)
serenachou Mar 4, 2024
cbb09d2
AwaitsFix for #101008
DaveCTurner Mar 4, 2024
294fa4d
[Connectors API] Add more distinct test cases to PutConnectorSecretAc…
timgrein Mar 4, 2024
3b8177f
[Connectors API] Make validation error message consistent and add tes…
timgrein Mar 4, 2024
c97160a
[ILM] Delete step deletes data stream with only one index (#105772)
andreidan Mar 4, 2024
9e5fbf6
Extract repository-resolution logic (#105760)
DaveCTurner Mar 4, 2024
3addbed
Restrict scope of `GetSnapshotInfoContext` (#105721)
DaveCTurner Mar 4, 2024
3a21ce6
Merge branch 'main' into lucene_snapshot_9_10
elasticmachine Mar 4, 2024
35ff280
Simplify TransportGetSnapshotsAction#sortSnapshots (#105895)
DaveCTurner Mar 4, 2024
7ddf519
Cleanup duplicate code in DenseVectorFieldMapper (#105887)
original-brownbear Mar 4, 2024
e55bdba
Update docs/changelog/105578.yaml
jpountz Mar 4, 2024
b96f8f0
Dry up some painless code (#105885)
original-brownbear Mar 4, 2024
9c1a079
Make Health API more resilient to multi-version clusters (#105789)
nielsbauman Mar 4, 2024
fc8e2b7
Introduce Predicate Utilities for always true/false use-cases (#105881)
original-brownbear Mar 4, 2024
c57d96a
Test mute for #105839 (#105902)
benwtrent Mar 4, 2024
6c11826
Merge branch 'lucene_snapshot_9_10'
benwtrent Mar 4, 2024
fdfc08a
Grow buckets on GlobalAggregator and RandomSamplerAggregator eagerly …
iverase Mar 4, 2024
0732628
Use constant predicate in `buildAfterPredicate` (#105905)
DaveCTurner Mar 4, 2024
6ae9dbf
[DOCS] Adds cohere service example to the inference API tutorial (#10…
szabosteve Mar 4, 2024
89786f5
Test mute for #105918 (#105919)
benwtrent Mar 4, 2024
6f87bd3
Skipping tests that are failing because of timezone field (#105924)
jonathan-buttner Mar 4, 2024
6ab69e5
ESQL: Don't test field extraction in 8.11 (#105909)
nik9000 Mar 4, 2024
93fd12d
Update health YAML REST test skip version (#105927)
nielsbauman Mar 4, 2024
ca10472
Make use of ActionListener#delegateFailureAndWrap in more spots in ML…
original-brownbear Mar 5, 2024
0dd92b0
Improve data_tier allocation explanation message (#105858)
idegtiarenko Mar 5, 2024
1c03489
YAML test framework: simplify version node_selector (#103954)
ldematte Mar 5, 2024
30828a5
Update geoip.asciidoc (#105908)
predogma Mar 5, 2024
d65461d
[DSL] Refactor effective data retention (#105750)
gmarouli Mar 5, 2024
3f7ccde
Merge remote-tracking branch 'origin/main' into feature/semantic-text
carlosdelest Mar 5, 2024
139c94b
Fix node_selector in new esql test (#105943)
ldematte Mar 5, 2024
e9ff896
Fix gradle run on Serverless (#105938)
tvernum Mar 5, 2024
1e76b18
YAML test framework: re-introduce `requires` section and `cluster_fea…
ldematte Mar 5, 2024
7191758
Unmute testRollupNonTSIndex() and (#105949)
martijnvg Mar 5, 2024
4f2c8ca
Test mute for #105952 (#105953)
benwtrent Mar 5, 2024
61b3d98
Add note about optional times and epochs (#105786)
benwtrent Mar 5, 2024
fbbfbd5
[test] Disable index.shard.check_on_startup for searchable snapshot t…
arteam Mar 5, 2024
7c6120b
Fix TransportSLMGetExpiredSnapshotsActionTests (#105950)
DaveCTurner Mar 5, 2024
335afe5
Fix performance bug in `SourceConfirmedTextQuery#matches` (#105930)
jimczi Mar 5, 2024
fe13a04
Bugfix for mixed version cluster queries using text expansion (#105912)
kderusso Mar 5, 2024
3e5c3c5
[ML] Enable retrying on 500 error response from Cohere text embedding…
jonathan-buttner Mar 5, 2024
881c394
Merge remote-tracking branch 'origin/main' into feature/semantic-text
carlosdelest Mar 5, 2024
b1a3ee8
Semantic text dense vector support (#105515)
carlosdelest Mar 6, 2024
2039fb3
This was supposed to be merged into #105515 but didn't make it
carlosdelest Mar 6, 2024
e9c5d72
Merge branch 'feature/semantic-text' into semantic-text-query
Mikep86 Mar 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected void doExecute(Task task, ValidateQueryRequest request, ActionListener
if (request.query() == null) {
rewriteListener.onResponse(request.query());
} else {
Rewriteable.rewriteAndFetch(request.query(), searchService.getRewriteContext(timeProvider), rewriteListener);
Rewriteable.rewriteAndFetch(request.query(), searchService.getRewriteContext(timeProvider, request), rewriteListener);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected void doExecute(Task task, ExplainRequest request, ActionListener<Expla

assert request.query() != null;
LongSupplier timeProvider = () -> request.nowInMillis;
Rewriteable.rewriteAndFetch(request.query(), searchService.getRewriteContext(timeProvider), rewriteListener);
Rewriteable.rewriteAndFetch(request.query(), searchService.getRewriteContext(timeProvider, request), rewriteListener);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,11 @@ void executeRequest(
}
}
});
Rewriteable.rewriteAndFetch(original, searchService.getRewriteContext(timeProvider::absoluteStartMillis), rewriteListener);
Rewriteable.rewriteAndFetch(
original,
searchService.getRewriteContext(timeProvider::absoluteStartMillis, original),
rewriteListener
);
}

static void adjustSearchType(SearchRequest searchRequest, boolean singleShard) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected void doExecute(Task task, SearchShardsRequest searchShardsRequest, Act
ClusterState clusterState = clusterService.state();
Rewriteable.rewriteAndFetch(
original,
searchService.getRewriteContext(timeProvider::absoluteStartMillis),
searchService.getRewriteContext(timeProvider::absoluteStartMillis, original),
listener.delegateFailureAndWrap((delegate, searchRequest) -> {
Map<String, OriginalIndices> groupedIndices = remoteClusterService.groupIndices(
searchRequest.indicesOptions(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,8 @@ public QueryRewriteContext newQueryRewriteContext(
namedWriteableRegistry,
valuesSourceRegistry,
allowExpensiveQueries,
scriptService
scriptService,
null
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public CoordinatorRewriteContext(
null,
null,
null,
null,
null
);
this.indexLongFieldRange = indexLongFieldRange;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.function.BooleanSupplier;
import java.util.function.LongSupplier;
import java.util.function.Predicate;
import java.util.stream.Collectors;

/**
* Context object used to rewrite {@link QueryBuilder} instances into simplified version.
Expand All @@ -59,6 +60,7 @@ public class QueryRewriteContext {
protected boolean allowUnmappedFields;
protected boolean mapUnmappedFieldAsString;
protected Predicate<String> allowedFields;
private final Map<String, Set<String>> modelsForFields;

public QueryRewriteContext(
final XContentParserConfiguration parserConfiguration,
Expand All @@ -74,7 +76,8 @@ public QueryRewriteContext(
final NamedWriteableRegistry namedWriteableRegistry,
final ValuesSourceRegistry valuesSourceRegistry,
final BooleanSupplier allowExpensiveQueries,
final ScriptCompiler scriptService
final ScriptCompiler scriptService,
final Map<String, Set<String>> modelsForFields
) {

this.parserConfiguration = parserConfiguration;
Expand All @@ -92,6 +95,9 @@ public QueryRewriteContext(
this.valuesSourceRegistry = valuesSourceRegistry;
this.allowExpensiveQueries = allowExpensiveQueries;
this.scriptService = scriptService;
this.modelsForFields = modelsForFields != null ?
modelsForFields.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> Set.copyOf(e.getValue()))) :
Collections.emptyMap();
}

public QueryRewriteContext(final XContentParserConfiguration parserConfiguration, final Client client, final LongSupplier nowInMillis) {
Expand All @@ -109,10 +115,36 @@ public QueryRewriteContext(final XContentParserConfiguration parserConfiguration
null,
null,
null,
null,
null
);
}

public QueryRewriteContext(
final XContentParserConfiguration parserConfiguration,
final Client client,
final LongSupplier nowInMillis,
final Map<String, Set<String>> modelsForFields
) {
this(
parserConfiguration,
client,
nowInMillis,
null,
MappingLookup.EMPTY,
Collections.emptyMap(),
null,
null,
null,
null,
null,
null,
null,
null,
modelsForFields
);
}

/**
* The registry used to build new {@link XContentParser}s. Contains registered named parsers needed to parse the query.
*
Expand Down Expand Up @@ -345,4 +377,9 @@ public Iterable<String> getAllFieldNames() {
? allFromMapping
: () -> Iterators.concat(allFromMapping.iterator(), runtimeMappings.keySet().iterator());
}

public Set<String> getModelsForField(String fieldName) {
Set<String> models = modelsForFields.get(fieldName);
return models != null ? models : Collections.emptySet();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ private SearchExecutionContext(
namedWriteableRegistry,
valuesSourceRegistry,
allowExpensiveQueries,
scriptService
scriptService,
null
);
this.shardId = shardId;
this.shardRequestIndex = shardRequestIndex;
Expand Down
18 changes: 16 additions & 2 deletions server/src/main/java/org/elasticsearch/indices/IndicesService.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ResourceAlreadyExistsException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.action.admin.indices.mapping.put.TransportAutoPutMappingAction;
import org.elasticsearch.action.admin.indices.mapping.put.TransportPutMappingAction;
Expand Down Expand Up @@ -151,6 +152,7 @@
import java.util.Collection;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -1695,8 +1697,20 @@ public AliasFilter buildAliasFilter(ClusterState state, String index, Set<String
/**
* Returns a new {@link QueryRewriteContext} with the given {@code now} provider
*/
public QueryRewriteContext getRewriteContext(LongSupplier nowInMillis) {
return new QueryRewriteContext(parserConfig, client, nowInMillis);
public QueryRewriteContext getRewriteContext(LongSupplier nowInMillis, IndicesRequest indicesRequest) {
Index[] indices = indexNameExpressionResolver.concreteIndices(clusterService.state(), indicesRequest);
Map<String, Set<String>> modelsForFields = new HashMap<>();
for (Index index : indices) {
Map<String, Set<String>> fieldsForModels = indexService(index).getMetadata().getFieldsForModels();
for (Map.Entry<String, Set<String>> entry : fieldsForModels.entrySet()) {
for (String fieldName : entry.getValue()) {
Set<String> models = modelsForFields.computeIfAbsent(fieldName, v -> new HashSet<>());
models.add(entry.getKey());
}
}
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

Rebuilding the modelsForFields map like this every time is obviously inefficient, but it should be fine for a small number of semantic_text fields.

I have some ideas about how to cache modelsForFields per index that should make this more performant, but it requires larger changes that would bloat this PR and increase its scope considerably. Probably better to iterate on this in a separate PR.


return new QueryRewriteContext(parserConfig, client, nowInMillis, modelsForFields);
}

public DataRewriteContext getDataRewriteContext(LongSupplier nowInMillis) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.elasticsearch.ElasticsearchTimeoutException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRunnable;
import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.search.CanMatchNodeRequest;
import org.elasticsearch.action.search.CanMatchNodeResponse;
import org.elasticsearch.action.search.SearchRequest;
Expand Down Expand Up @@ -1759,8 +1760,8 @@ private void rewriteAndFetchShardRequest(IndexShard shard, ShardSearchRequest re
/**
* Returns a new {@link QueryRewriteContext} with the given {@code now} provider
*/
public QueryRewriteContext getRewriteContext(LongSupplier nowInMillis) {
return indicesService.getRewriteContext(nowInMillis);
public QueryRewriteContext getRewriteContext(LongSupplier nowInMillis, IndicesRequest indicesRequest) {
return indicesService.getRewriteContext(nowInMillis, indicesRequest);
}

public CoordinatorRewriteContextProvider getCoordinatorRewriteContextProvider(LongSupplier nowInMillis) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.hasSize;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -1717,7 +1718,7 @@ protected void doWriteTo(StreamOutput out) throws IOException {
NodeClient client = new NodeClient(settings, threadPool);

SearchService searchService = mock(SearchService.class);
when(searchService.getRewriteContext(any())).thenReturn(new QueryRewriteContext(null, null, null));
when(searchService.getRewriteContext(any(), eq(searchRequest))).thenReturn(new QueryRewriteContext(null, null, null));
ClusterService clusterService = new ClusterService(
settings,
new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,8 @@ QueryRewriteContext createQueryRewriteContext() {
namedWriteableRegistry,
null,
() -> true,
scriptService
scriptService,
null
);
}

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/inference/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
requires org.apache.httpcomponents.httpcore.nio;
requires org.apache.lucene.core;
requires org.elasticsearch.logging;
requires org.apache.lucene.join;

exports org.elasticsearch.xpack.inference.action;
exports org.elasticsearch.xpack.inference.registry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.elasticsearch.features.NodeFeature;
import org.elasticsearch.index.mapper.Mapper;
import org.elasticsearch.index.mapper.MetadataFieldMapper;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.indices.SystemIndexDescriptor;
import org.elasticsearch.inference.InferenceServiceExtension;
import org.elasticsearch.inference.InferenceServiceRegistry;
Expand All @@ -33,6 +34,7 @@
import org.elasticsearch.plugins.InferenceRegistryPlugin;
import org.elasticsearch.plugins.MapperPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.plugins.SystemIndexPlugin;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestHandler;
Expand All @@ -58,6 +60,7 @@
import org.elasticsearch.xpack.inference.logging.ThrottlerManager;
import org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper;
import org.elasticsearch.xpack.inference.mapper.SemanticTextInferenceResultFieldMapper;
import org.elasticsearch.xpack.inference.queries.SemanticQueryBuilder;
import org.elasticsearch.xpack.inference.registry.ModelRegistryImpl;
import org.elasticsearch.xpack.inference.rest.RestDeleteInferenceModelAction;
import org.elasticsearch.xpack.inference.rest.RestGetInferenceModelAction;
Expand Down Expand Up @@ -86,7 +89,8 @@ public class InferencePlugin extends Plugin
ExtensiblePlugin,
SystemIndexPlugin,
InferenceRegistryPlugin,
MapperPlugin {
MapperPlugin,
SearchPlugin {

/**
* When this setting is true the verification check that
Expand Down Expand Up @@ -300,4 +304,13 @@ public Map<String, Mapper.TypeParser> getMappers() {
public Map<String, MetadataFieldMapper.TypeParser> getMetadataMappers() {
return Map.of(SemanticTextInferenceResultFieldMapper.NAME, SemanticTextInferenceResultFieldMapper.PARSER);
}

@Override
public List<QuerySpec<?>> getQueries() {
return List.of(new QuerySpec<QueryBuilder>(
SemanticQueryBuilder.NAME,
SemanticQueryBuilder::new,
SemanticQueryBuilder::fromXContent
));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@

package org.elasticsearch.xpack.inference.mapper;

import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.BoostQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.join.BitSetProducer;
import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.index.fielddata.FieldDataContext;
import org.elasticsearch.index.fielddata.IndexFieldData;
import org.elasticsearch.index.mapper.DocumentParserContext;
Expand All @@ -21,10 +29,15 @@
import org.elasticsearch.index.mapper.TextSearchInfo;
import org.elasticsearch.index.mapper.ValueFetcher;
import org.elasticsearch.index.query.SearchExecutionContext;
import org.elasticsearch.index.search.ESToParentBlockJoinQuery;
import org.elasticsearch.inference.InferenceResults;
import org.elasticsearch.xpack.core.ml.inference.results.TextExpansionResults;

import java.io.IOException;
import java.util.Map;

import static org.elasticsearch.action.bulk.BulkShardRequestInferenceProvider.INFERENCE_CHUNKS_RESULTS;

/**
* A {@link FieldMapper} for semantic text fields. These fields have a model id reference, that is used for performing inference
* at ingestion and query time.
Expand Down Expand Up @@ -126,5 +139,38 @@ public ValueFetcher valueFetcher(SearchExecutionContext context, String format)
public IndexFieldData.Builder fielddataBuilder(FieldDataContext fieldDataContext) {
throw new IllegalArgumentException("[semantic_text] fields do not support sorting, scripting or aggregating");
}

public Query semanticQuery(
InferenceResults inferenceResults,
SearchExecutionContext context,
float boost,
String queryName
) {
// Cant use QueryBuilders.boolQuery() because a mapper is not registered for <field>.inference, causing
// TermQueryBuilder#doToQuery to fail (at TermQueryBuilder:202)
// TODO: Handle boost and queryName
Copy link
Owner Author

Choose a reason for hiding this comment

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

TextExpansionQueryBuilder uses QueryBuilders.boolQuery() to build the boolean query, which has the side-effect of handling boost and queryName in AbstractQueryBuilder#toQuery. However, that doesn't work here because we then have to use TermQueryBuilder to build term queries, which fails in this context in doToQuery because semantic_query relies on "shadow" mappings that are coordinated between the query & SemanticTextInferenceResultFieldMapper.

I see two ways to resolve this:

  • Duplicate the boost & queryName handling logic here
  • Factor out the boost & queryName handling logic to a static util method and call it here

WDYT?

String fieldName = name() + "." + INFERENCE_CHUNKS_RESULTS;
BooleanQuery.Builder queryBuilder = new BooleanQuery.Builder().setMinimumNumberShouldMatch(1);

// TODO: Support dense vectors
if (inferenceResults instanceof TextExpansionResults textExpansionResults) {
for (TextExpansionResults.WeightedToken weightedToken : textExpansionResults.getWeightedTokens()) {
queryBuilder.add(
new BoostQuery(
new TermQuery(
new Term(fieldName, weightedToken.token())
),
weightedToken.weight()
),
BooleanClause.Occur.SHOULD
);
}
} else {
throw new IllegalArgumentException("Unsupported inference results type [" + inferenceResults.getWriteableName() + "]");
}

BitSetProducer parentFilter = context.bitsetFilter(Queries.newNonNestedFilter(context.indexVersionCreated()));
return new ESToParentBlockJoinQuery(queryBuilder.build(), parentFilter, ScoreMode.Total, name());
}
}
}
Loading