apache / apache/lucene

Can we enforce more properties on fields like uniquness [LUCENE-8342]

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

Description

This is a spin-off from #9382 where we discuss adding a boolean to FieldInfo to check if the field is used for soft deletes. This has been a a very delicate line we drew in the past but if we take a step back and think about how we'd design a feature like IW#updateDocument(Term, Document) today would we allow passing different fields to this API? It's just one example ie. storing floats and ints in the same DV field is a different one. I personally think it would be a good idea to be more strict on that end and I wonder what others think.

---
Migrated from [LUCENE-8342](https://issues.apache.org/jira/browse/LUCENE-8342) by Simon Willnauer (@s1monw), updated Dec 08 2021

Contributor guide

Open the contributing guide

Research direction

Start by reading the discussion in #9382 and the references to FieldInfo, soft deletes, and IW#updateDocument(Term, Document). Compare the examples about differing fields and data types, then determine whether the project has agreed on stricter field-property enforcement. Done requires a settled design and explicit compatibility or validation requirements.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.