Neural search transforms text into vectors and facilitates vector search both at ingestion time and at search time.
  • Java 97.8%
  • C++ 1.4%
  • Shell 0.3%
  • Python 0.3%
  • CMake 0.2%
Find a file
Chang Yong Lik 9a2411225c
[Hybrid Query] Normalize scores once when explain is enabled (#2104)
* Normalize hybrid query scores once when explain is enabled

With explain enabled, the normalization processor workflow explained
the normalization before running it, and each technique's explain()
wrote the normalized score back into the TopDocs it explained.
normalizeScores then normalized those scores a second time. The
response's _score and the explanation's top node reported the second
pass, while the explanation's children held the first one. For z_score
this changed the hit order.

explain() of the min_max, z_score, l2 and rrf techniques no longer
writes to scoreDoc.score. The workflow explains the normalization on
the raw scores, normalizes once, then explains the combination on the
normalized scores, which are the ones combineScores reads.

Resolves #2097

Signed-off-by: ahlag <theeahlag@gmail.com>

* Add CHANGELOG entry for #2104

Signed-off-by: ahlag <theeahlag@gmail.com>

* Cover explain ordering, l2 on 3 shards and min_score in explain tests

- NormalizationProcessorWorkflowTests: check that the normalization
  explanation children average to the combined score, which fails if
  normalization is explained after normalizeScores.
- HybridQueryExplainIT: check _explanation on every hit, run on 1 and 3
  shards (l2 only drifts on more than one shard), and compare with and
  without explain under a min_score. Before the fix that min_score
  returned a 500 for z_score on 1 shard (IndexOutOfBoundsException in
  ExplanationResponseProcessor).

Signed-off-by: ahlag <theeahlag@gmail.com>

---------

Signed-off-by: ahlag <theeahlag@gmail.com>
2026-12-02 11:04:29 -08:00
.github Increment version to 3.11.0-SNAPSHOT (#2094) 2026-11-19 16:37:41 -08:00
.idea Enabled the K-NN plugin and ML plugin for integ test cluster. (#6) 2022-09-29 11:39:47 -07:00
formatter Guard eclipse() to spotless tasks and keep P2 mirror on pinned version (neural-search) (#1988) 2026-09-03 10:56:10 -04:00
gradle/wrapper Upgrade gradle wrapper to 9.4.1 (#1849) 2026-05-05 12:26:49 -07:00
jni [Sparse ANN] Bump neural-sparse-cpp submodule for the DiskSeismic mmap madvise fix (#55) (#2005) 2026-09-14 15:30:16 +08:00
qa Gate score-and-field sort on the release that ships it (#2103) 2026-11-20 13:03:21 -08:00
release-notes Add release notes for 3.10.1 (#2109) (#2111) 2026-11-23 22:02:13 -05:00
scripts [Sparse ANN] [Native] Ship the native sparse engine in the distribution build (#1978) 2026-09-03 15:44:34 +08:00
src [Hybrid Query] Normalize scores once when explain is enabled (#2104) 2026-12-02 11:04:29 -08:00
.gitignore [Sparse ANN] [Native] Add the nsparse JNI layer for the native sparse engine (#1972) 2026-08-31 15:05:50 +08:00
.gitmodules [Sparse ANN] [Native] Add the nsparse JNI layer for the native sparse engine (#1972) 2026-08-31 15:05:50 +08:00
.whitesource Add .whitesource configuration file (#51) 2023-03-20 20:12:01 -07:00
ADMINS.md [#1]Fix CI and Link Checker github workflows (#3) 2022-09-26 11:17:20 -07:00
build.gradle Increment version to 3.11.0-SNAPSHOT (#2094) 2026-11-19 16:37:41 -08:00
CHANGELOG.md [Hybrid Query] Normalize scores once when explain is enabled (#2104) 2026-12-02 11:04:29 -08:00
CODE_OF_CONDUCT.md Initial commit 2022-09-22 20:20:37 -07:00
codecov.yml Update codecov to check during PR (#995) 2024-11-19 13:49:15 -08:00
CONTRIBUTING.md Support k-NN radial search parameters in neural search (#697) 2024-04-23 08:46:31 -07:00
DEVELOPER_GUIDE.md Add hybrid DLS cross-plugin integration tests (#1957) 2026-09-04 13:39:37 -07:00
gradle.properties Increment version to 3.11.0-SNAPSHOT (#2094) 2026-11-19 16:37:41 -08:00
gradlew Upgrade to gradle 9.2 and run CI with JDK 25 (#1667) 2025-11-21 15:40:33 -08:00
gradlew.bat Upgrade to gradle 9.2 and run CI with JDK 25 (#1667) 2025-11-21 15:40:33 -08:00
LICENSE Initial commit 2022-09-22 20:20:37 -07:00
lombok.config Added MLCommonsClientAcessor and MLPredict TransportAction for accessing the MLClient APIs predict API. (#16) 2022-10-10 17:53:00 -07:00
MAINTAINERS.md Update maintainer status for VijayanB (#2035) 2026-10-12 13:40:12 -07:00
NOTICE Initial commit 2022-09-22 20:20:37 -07:00
README.md Initial commit for adding BWC tests in neural search plugin (#515) 2024-01-02 13:03:47 -08:00
RELEASING.md Upgrade to gradle 9.2 and run CI with JDK 25 (#1667) 2025-11-21 15:40:33 -08:00
repositories.gradle Add ci.opensearch.org/m2/ mirror for plugin resolution (neural-search) (#1920) (#1921) 2026-07-31 17:42:10 -04:00
SECURITY.md Updating security reachout email (#748) 2024-05-27 09:57:49 +08:00
settings.gradle Add ci.opensearch.org/m2/ mirror for plugin resolution (neural-search) (#1920) (#1921) 2026-07-31 17:42:10 -04:00
TRIAGING.md Upgrade BWC version and fix neural search build (#868) 2024-08-20 16:58:48 -07:00

Build and Test Neural Search codecov Documentation Chat PRs welcome!

OpenSearch Neural Search is an OpenSearch plugin that adds dense neural retrieval into the OpenSearch ecosystem. The plugin provides the capability for indexing documents and doing neural search on the indexed documents.

Project Resources

Code of Conduct

This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ, or contact opensource-codeofconduct@amazon.com with any additional questions or comments.

License

This project is licensed under the Apache v2.0 License.

Copyright OpenSearch Contributors. See NOTICE for details.