byte to int in TruncateTokenFilterFactory to TruncateTokenFilter
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
### Description
TruncateTokenFilterFactory class parses PREFIX_LENGTH_KEY value as Byte which goes upto 127 and then is stored in prefixLength attribute. TruncateTokenFilter class expects the argument in int which has a bigger range than byte. Any value greater than 127 throws a exception while being parsed as Byte in the TruncateTokenFilterFactory class.
I didnt see any documentation in the TruncateTokenFilterFactory class that this value should be less than 128.
### Version and environment details
Lucene 9.7.0 . Also verified in latest main code.
Contributor guide
Research direction
Start with TruncateTokenFilterFactory, where PREFIX_LENGTH_KEY is parsed, and compare its prefixLength handoff with TruncateTokenFilter’s int parameter. Verify that values greater than 127 are accepted without a parsing exception, and check whether the factory documentation needs updating.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100