apache / apache/lucene

Can we move SortField.Type.SCORE/DOC to singleton SortField instances instead...? [LUCENE-4722]

Open
#5,787 3 comments 0 reactions 0 assignees View on GitHub
legacy-jira-fix-version:4.9 legacy-jira-fix-version:6.0 legacy-jira-priority:Major type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

It's ... weird that you can do eg new SortField("myfield", SortField.Type.SCORE).

We already have dedicated SortField.FIELD_SCORE and FIELD_DOC ... so I think apps should use those and never make a new SortField for them?

---
Migrated from [LUCENE-4722](https://issues.apache.org/jira/browse/LUCENE-4722) by Michael McCandless (@mikemccand), updated May 09 2016

Contributor guide

Open the contributing guide

Research direction

Start by inspecting SortField.Type.SCORE and DOC alongside the existing SortField.FIELD_SCORE and FIELD_DOC entry points. Determine the compatibility implications of discouraging or removing construction with those types, then verify that the dedicated singleton instances cover the intended uses and update the relevant tests if they are found.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.