Commit graph

85 commits

Author SHA1 Message Date
Armin Braun
a40c6da0d8
Cleanup dead code in o.e.search and o.e.a.search (#124445)
Just some obvious cleanups for stuff that became unused as of late.
2025-03-10 09:11:15 +01:00
Tim Vernum
81043b5ce0 Merge revision 2eb0d00b8f into multi-project 2025-02-19 16:00:15 +11:00
Simon Cooper
fc2f8fc1f6
Optionally allow text similarity reranking to fail (#121784)
Add an option to allow reranking to fail, and the docs to pass through as-is.
Exposing the error to users and adding documentation is a later piece of work.
2025-02-17 13:32:17 +00:00
Tim Vernum
d271a48c2a Merge main into multi-project 2025-02-17 17:05:19 +11:00
Panagiotis Bailis
95f8454e40
Update test_reranking_service to try and parse provided inputs as scores (#122328) 2025-02-14 12:30:10 +02:00
Niels Bauman
621a18d947 Merge main into multi-project 2025-01-30 17:26:28 +10:00
Panagiotis Bailis
375814d007
Adding linear retriever to support weighted sums of sub-retrievers (#120222) 2025-01-28 19:33:12 +02:00
Panagiotis Bailis
86fbec3cd4
Avoid populating rank docs metadata if explain is not specified (#120536) 2025-01-24 08:25:37 +02:00
Simon Cooper
5a70623d8d Merge remote-tracking branch 'upstream-main/main' into merge-main-16-01-25 2025-01-16 09:23:46 +00:00
Simon Cooper
ca4ea21fb3
Remove assumed features in xpack for 9.0 (#120049)
Remove all assumed features defined in xpack added before 8.18
2025-01-15 11:06:30 +00:00
Simon Cooper
a2d84b1b90
Remove assumed features in server for 9.0 (#119946)
All features added before 8.18 can now be assumed and removed in 9.0
2025-01-15 08:37:04 +00:00
Niels Bauman
83acbcb36b Merge main into multi-project 2025-01-10 15:08:22 +10:00
Simon Cooper
75d1050781
Mark all features added before 8.18 as assumed (#119055)
Features added before 8.18 can be removed, starting with 9.0. But first they need to be marked as assumed, so existing code knows they could be removed in later builds.
2025-01-09 16:59:25 +00:00
Tim Vernum
4ff691f066 Merge revision 7fb6ca447a into multi-project 2024-12-31 15:41:02 +11:00
Rene Groeschke
ba61f8c7f7
Update Gradle wrapper to 8.12 (#118683)
This updates the gradle wrapper to 8.12

We addressed deprecation warnings due to the update that includes:

- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions
2024-12-30 15:34:24 +01:00
Yang Wang
f7791a0f5f Merge main into multi-project 2024-12-19 14:36:37 +11:00
Jim Ferenczi
6f261067f2
Add a generic rescorer retriever based on the search request's rescore functionality (#118585)
This pull request introduces a new retriever called `rescorer`, which leverages the `rescore` functionality of the search request.  
The `rescorer` retriever re-scores only the top documents retrieved by its child retriever, offering fine-tuned scoring capabilities.  

All rescorers supported in the `rescore` section of a search request are available in this retriever, and the same format is used to define the rescore configuration.  

<details>
<summary>Example:</summary>

```yaml
  - do:
      search:
        index: test
        body:
          retriever:
            rescorer:
              rescore:
                window_size: 10
                query:
                  rescore_query:
                    rank_feature:
                      field: "features.second_stage"
                      linear: { }
                  query_weight: 0
              retriever:
                standard:
                  query:
                    rank_feature:
                      field: "features.first_stage"
                      linear: { }
          size: 2
```

</details>

Closes #118327

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2024-12-18 19:47:12 +00:00
Yang Wang
fda1fa19d4 Merge main into multi-project 2024-12-13 12:15:25 +11:00
Kathleen DeRusso
c9a6a2c841
Add match support for semantic_text fields (#117839)
* Added query name to inference field metadata

* Fix build error

* Added query builder service

* Add query builder service to query rewrite context

* Updated match query to support querying semantic text fields

* Fix build error

* Fix NPE

* Update the POC to rewrite to a bool query when combined inference and non-inference fields

* Separate clause for each inference index (to avoid inference ID clashes)

* Simplify query builder service concept to a single default inference query

* Rename QueryBuilderService, remove query name from inference metadata

* Fix too many rewrite rounds error by injecting booleans in constructors for match query builder and semantic text

* Fix test compilation errors

* Fix tests

* Add yaml test for semantic match

* Add NodeFeature

* Fix license headers

* Spotless

* Updated getClass comparison in MatchQueryBuilder

* Cleanup

* Add Mock Inference Query Builder Service

* Spotless

* Cleanup

* Update docs/changelog/117839.yaml

* Update changelog

* Replace the default inference query builder with a query rewrite interceptor

* Cleanup

* Some more cleanup/renames

* Some more cleanup/renames

* Spotless

* Checkstyle

* Convert List<QueryRewriteInterceptor> to Map keyed on query name, error on query name collisions

* PR feedback - remove check on QueryRewriteContext class only

* PR feedback

* Remove intercept flag from MatchQueryBuilder and replace with wrapper

* Move feature to test feature

* Ensure interception happens only once

* Rename InterceptedQueryBuilderWrapper to AbstractQueryBuilderWrapper

* Add lenient field to SemanticQueryBuilder

* Clean up yaml test

* Add TODO comment

* Add comment

* Spotless

* Rename AbstractQueryBuilderWrapper back to InterceptedQueryBuilderWrapper

* Spotless

* Didn't mean to commit that

* Remove static class wrapping the InterceptedQueryBuilderWrapper

* Make InterceptedQueryBuilderWrapper part of QueryRewriteInterceptor

* Refactor the interceptor to be an internal plugin that cannot be used outside inference plugin

* Fix tests

* Spotless

* Minor cleanup

* C'mon spotless

* Test spotless

* Cleanup InternalQueryRewriter

* Change if statement to assert

* Simplify template of InterceptedQueryBuilderWrapper

* Change constructor of InterceptedQueryBuilderWrapper

* Refactor InterceptedQueryBuilderWrapper to extend QueryBuilder

* Cleanup

* Add test

* Spotless

* Rename rewrite to interceptAndRewrite in QueryRewriteInterceptor

* DOESN'T WORK - for testing

* Add comment

* Getting closer - match on single typed fields works now

* Deleted line by mistake

* Checkstyle

* Fix over-aggressive IntelliJ Refactor/Rename

* And another one

* Move SemanticMatchQueryRewriteInterceptor.SEMANTIC_MATCH_QUERY_REWRITE_INTERCEPTION_SUPPORTED to Test feature

* PR feedback

* Require query name with no default

* PR feedback & update test

* Add rewrite test

* Update server/src/main/java/org/elasticsearch/index/query/InnerHitContextBuilder.java

Co-authored-by: Mike Pellegrini <mike.pellegrini@elastic.co>

---------

Co-authored-by: Mike Pellegrini <mike.pellegrini@elastic.co>
2024-12-12 16:55:00 +01:00
Tim Vernum
e5a0739005 Merge main into multi-project 2024-12-12 17:23:24 +11:00
Carlos Delgado
59967727cf
kNN vector rescoring for quantized vectors (#116663) 2024-12-11 09:14:18 +01:00
Niels Bauman
ffe911bd3c Merge main into multi-project 2024-12-05 13:25:44 +01:00
Simon Cooper
6fe8894adc
Collapse transport versions for 8.16 (#117991) 2024-12-05 08:59:48 +00:00
Panagiotis Bailis
0d4c0f2080
Fix for propagating filters from compound to inner retrievers (#117914) 2024-12-05 09:06:53 +02:00
Niels Bauman
0edb9fa778 Merge remote-tracking branch 'public/main' into merge-main
# Conflicts:
#	server/src/main/java/org/elasticsearch/action/search/TransportSearchShardsAction.java
#	server/src/main/java/org/elasticsearch/cluster/routing/allocation/AllocationStatsService.java
#	server/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java
#	server/src/main/java/org/elasticsearch/plugins/Plugin.java
#	server/src/test/java/org/elasticsearch/gateway/GatewayMetaStateTests.java
#	server/src/test/java/org/elasticsearch/ingest/IngestMetadataTests.java
2024-11-18 10:53:12 +01:00
Panagiotis Bailis
5b25dee334
Propagating nested inner_hits to the parent compound retriever (#116408) 2024-11-13 10:21:37 +02:00
Tim Vernum
17c27bc42b Merge main into multi-project 2024-11-11 16:28:45 +11:00
Panagiotis Bailis
3f369d3e90
Wrapping TermQueryBuilders into ConstantScoreBuilders to ensure consistent scoring (#112607) 2024-11-08 15:08:32 +02:00
Yang Wang
c64e5a9e01 Merge remote-tracking branch 'origin/multi-project' into merge/main/20241108T15 2024-11-08 15:42:14 +11:00
Panagiotis Bailis
7794bef6f3
Transforming rank rrf to the corresponding retriever (#115026) 2024-11-07 16:50:26 +02:00
Yang Wang
1206819628 Merge remote-tracking branch 'stateful/main' into tmp 2024-10-25 19:14:05 +11:00
Matteo Piergiovanni
7f573c6c28
Only aggregations require at least one shard request (#115314)
* unskipping shards only when aggs

* Update docs/changelog/115314.yaml

* fixed more tests

* null check for searchRequest.source()
2024-10-25 08:50:05 +02:00
Tim Vernum
fd55e00fa7 Merge main into multi-project 2024-10-25 14:21:13 +11:00
Panagiotis Bailis
e99607b589
Adding breaking change entry for retrievers (#115399) 2024-10-24 16:29:14 +03:00
Tim Vernum
616bb2622e Merge main into multi-project 2024-10-24 13:09:21 +11:00
Panagiotis Bailis
1ca39789e2
Updating error handling for compound retrievers (#115277) 2024-10-23 17:40:18 +03:00
Tim Vernum
d4e4b5abb0 Merge main into multi-project 2024-10-22 13:03:12 +11:00
Luca Cavanna
8efd08b019
Upgrade to Lucene 10 (#114741)
The most relevant ES changes that upgrading to Lucene 10 requires are:

- use the appropriate IOContext
- Scorer / ScorerSupplier breaking changes
- Regex automaton are no longer determinized by default
- minimize moved to test classes
- introduce Elasticsearch900Codec
- adjust slicing code according to the added support for intra-segment concurrency
- disable intra-segment concurrency in tests
- adjust accessor methods for many Lucene classes that became a record
- adapt to breaking changes in the analysis area

Co-authored-by: Christoph Büscher <christophbuescher@posteo.de>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: ChrisHegarty <chegar999@gmail.com>
Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
Co-authored-by: Armin Braun <me@obrown.io>
Co-authored-by: Panagiotis Bailis <pmpailis@gmail.com>
Co-authored-by: Benjamin Trent <4357155+benwtrent@users.noreply.github.com>
2024-10-21 13:38:23 +02:00
Albert Zaharovits
1defecfead Merge main into multi-project 2024-10-17 19:28:15 +03:00
Panagiotis Bailis
8d0e63057f
Updating text_similarity_reranker tests to account for the test_reranking_service (#114945) 2024-10-17 15:33:40 +03:00
Tim Vernum
ad798a15af Merge main into multi-project 2024-10-17 18:13:14 +11:00
Panagiotis Bailis
e79127ba2a
Adding deprecation warnings for rank and sub_searches (#114854) 2024-10-16 21:56:13 +03:00
Panagiotis Bailis
bc0a6e8ee2
Fixing randomization issue for RRFRetrieverBuilderNestedDocsIT (#114859) 2024-10-16 07:23:58 +03:00
Tim Vernum
524a328819 Merge main into multi-project 2024-10-16 10:29:26 +11:00
Panagiotis Bailis
4fa8485a26
Ensuring consistent ordering for inner hits in collapse test for rrf (#114740) 2024-10-15 22:11:55 +03:00
Panagiotis Bailis
2f1f24d7f2
Updating queries used in rrf with text similarity tests (#114838) 2024-10-15 18:27:53 +03:00
Simon Cooper
f981d1f9e2 Merge remote-tracking branch 'upstream-main/main' into update-main-10-10-24 2024-10-10 13:27:33 +01:00
Panagiotis Bailis
4eab631e5f
Add telemetry for retrievers (#114109) 2024-10-10 09:57:42 +03:00
Jim Ferenczi
1708d9e25e
Ensure that all rewriteable are called in retrievers (#114366)
This PR ensures that all retriever applies the rewrite to all their rewriteable.
Rewriting eagerly at the retriever level ensures that we don't rewrite the same query multiple times
when compound retrievers are used.
2024-10-09 23:10:21 +01:00
Simon Cooper
09f91cdaec Merge branch 'main' into main-update-9-10-24 2024-10-09 17:08:05 +01:00