lucene icon indicating copy to clipboard operation
lucene copied to clipboard

byte to int in TruncateTokenFilterFactory to TruncateTokenFilter

Open asubbu90 opened this issue 2 years ago • 3 comments

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.

asubbu90 avatar Jul 19 '23 04:07 asubbu90

Hi @asubbu90

My name is Rohan Jha, I'm a Masters student at UT Austin taking a graduate Distributed Systems course. As part of my course project - contributing to OSS, I'm interested in contributing to Lucene by working on this issue.

Thanks!

robro612 avatar Oct 31 '23 21:10 robro612

Hi @robro612 , you can see I have already opened a PR #12507 on this issue. Do you want to have more context on this?

asubbu90 avatar Nov 01 '23 17:11 asubbu90

The PR got merged, this can be closed.

scampi avatar Jan 26 '24 21:01 scampi