apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.73k stars 1.04k forks source link

byte to int in TruncateTokenFilterFactory to TruncateTokenFilter #12449

Open asubbu90 opened 1 year ago

asubbu90 commented 1 year ago

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.

robro612 commented 1 year ago

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!

asubbu90 commented 1 year ago

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

scampi commented 10 months ago

The PR got merged, this can be closed.