apache / apache/lucene

remove Collector specializations [LUCENE-5229]

Open
#6,293 3 comments 0 reactions 1 assignee Claimed by @rmuir View on GitHub
legacy-jira-priority:Major type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

There are too many collector specializations (i think 16 or 18?) and too many crazy defaults like returning NaN scores to the user by default in indexsearcher.

this confuses hotspot (I will ignore any benchmarks posted here where only one type of sort is running thru the JVM, thats unrealistic), and confuses users with stuff like NaN scores coming back by default.

I have two concerete suggestions:

- nuke doMaxScores. its implicit from doScores. This is just over the top. This should also halve the collectors.
- change doScores to true by default in indexsearcher. since shai was confused by the NaNs by default, and he added this stuff to lucene, that says **everything** about how wrong this default is. Someone who **does** understand what it does can simply pass false.

---
Migrated from [LUCENE-5229](https://issues.apache.org/jira/browse/LUCENE-5229) by Robert Muir (@rmuir)
Sub-tasks:
- #6296

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.