apache / apache/lucene

I wish Lucene query explanations were easier to localise [LUCENE-3013]

Open
#4,087 1 comment 0 reactions 0 assignees View on GitHub
legacy-jira-label:gsoc2014 legacy-jira-priority:Major module:core/query/scoring type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Often users ask us to provide a nice UI to explain why a document matched their query. Currently the strings output by Explanation are very advanced, and probably only understandable to those who have worked on Lucene. I took a shot at trying to make them friendlier, but it basically came down to parsing the strings it output and trying to figure out what kind of query was at each point (the inability to get to a Query from the Explanation is a small part of the problem here), formulating the result into readable English. In the end it seems a bit too hard.

The solution to this could be done in at least two ways:

1. Add getLocalizedSummary() / getLocalizedDescription() method(s) and use resource bundles internally. Projects wishing to localise these could add their own resource bundles to the classpath and/or get them contributed to Lucene.

2. Add subclasses of Explanation with enough methods for callers to interrogate the individual details of the explanation instead of outputting it as a monolithic string.

I do like the tree structure of explanations a lot (as it resembles the query tree), I just think there is work to be done splitting up the strings into usable fragments of information.

---
Migrated from [LUCENE-3013](https://issues.apache.org/jira/browse/LUCENE-3013) by Trejkaz, 1 vote, updated Jan 29 2014
Linked issues:
- #4191
- [SOLR-3124](https://issues.apache.org/jira/browse/SOLR-3124)

Contributor guide

Open the contributing guide

Research direction

Start by reading the Explanation API and the issue's linked discussions, including #4191 and SOLR-3124. Compare the proposed localized string methods with structured Explanation subclasses, then clarify the desired API and localization behavior; the issue is done when a concrete approach and acceptance criteria are agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.