• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

deepset-ai / haystack / 22175870256

19 Feb 2026 09:22AM UTC coverage: 92.68% (-0.02%) from 92.699%
22175870256

push

github

web-flow
feat: add flexible document comparison field to retrieval evaluators (#10604)

* feat: add flexible document comparison field to retrieval evaluators

Add a `document_comparison_field` parameter to DocumentMRREvaluator,
DocumentMAPEvaluator, and DocumentRecallEvaluator. This allows users
to compare documents by `id` or `meta.<key>` instead of the previously
hardcoded `doc.content`.

Closes #9331

* fix: address review feedback for document comparison field

- Use single backticks in docstrings instead of double backticks
- Support nested meta fields (e.g. meta.source.url) matching filtering logic
- Use walrus operator to avoid duplicate _get_comparison_value calls
- Handle {None} in recall validity checks alongside {""}
- Improve warning messages for invalid comparison values
- Simplify mode function selection with if/elif
- Use list comprehension for score calculation
- Fix release notes wording

* style: format test_document_recall.py

* test: add nested meta field tests for document evaluators

---------

Co-authored-by: yaowubarbara <yaowubarbara@users.noreply.github.com>
Co-authored-by: bogdankostic <bogdankostic@web.de>

15332 of 16543 relevant lines covered (92.68%)

0.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.3
haystack/components/evaluators/document_map.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc