apache / apache/lucene

Don't require users to call Sort.rewrite() [LUCENE-4553]

Open
#5,619 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Minor module:core/search type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

I was looking at a call to Sort.rewrite() in some code that uses Lucene and it struck me as a little curious. It appears similar in spirit to Query.rewrite() yet user code never calls Query.rewrite(), Lucene will call that one. Shouldn't Sort/SortField rewrite() work the same way? There's nothing to remind you right now to call rewrite(), no javadoc mention even.

---
Migrated from [LUCENE-4553](https://issues.apache.org/jira/browse/LUCENE-4553) by David Smiley (@dsmiley)

Contributor guide

Open the contributing guide

Research direction

The issue identifies Sort.rewrite(), SortField.rewrite(), and Query.rewrite() as the relevant entry points. Read how these rewrite methods are currently invoked and determine what behavior would let users avoid calling Sort.rewrite(); done should include matching automatic handling and coverage for the changed usage.

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.