apache / apache/lucene

StringFields name is unintuitive and not helpful [LUCENE-4369]

Open
#5,435 44 comments 0 reactions 0 assignees 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's a huge difference between TextField and StringField, StringField screws up scoring and bypasses your Analyzer.

(see java-user thread "Custom Analyzer Not Called When Indexing" as an example.)

The name we use here is vital, otherwise people will get bad results.

I think we should rename StringField to MatchOnlyField.

---
Migrated from [LUCENE-4369](https://issues.apache.org/jira/browse/LUCENE-4369) by Robert Muir (@rmuir), updated Sep 18 2012
Attachments: [LUCENE-4369.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-4369/LUCENE-4369.patch)
Linked issues:
- #2440
- #4865

Contributor guide

Open the contributing guide

Research direction

Start by comparing StringField and TextField, then review the linked issues #2440 and #4865 and the referenced java-user thread about analyzers. The proposed outcome is to decide whether StringField should be renamed to MatchOnlyField and account for the naming change across the affected API.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.