msokolov commented on issue #17016: URL: https://github.com/apache/lucene/issues/17016#issuecomment-7087698623
One thing that is kind of messed up about our analysis is that it requires offsets, and it requires that offsets be "correct" (ie never go backwards with positions going forwards -- I think that's the rule, anyway), but offsets are really only ever used for highlighting. So if you don't use highlighting, but you make custom token filters, then you have to spend a lot of effort worrying about generating correct offsets in order to satisfy the indexing chain, although those offsets will never be read. So one thing we might consider is changing our indexing formats so that offsets are not required in order to also store positions. But failing that, we need to comply with forward-going offset rules (since the indexer relies on them when encoding offsets). The reason it's challenging to comply with the "correct offsets" rule has to do with filters that change the lengths and numbers of their tokens. Things like word delimiter filter does this when it splits a single token into multiple tokens. We have some complex token filters for processing numbers (things like 1-5, 2d, 4th, 3x5, and numbers with units: we want 3' and "3 feet" to tokenize to the same thing, and 1/2 and 0.5 and so on), and complying with the offset rules in in these cases has proven impossible, so we rely on "fix broken offsets" to generate something that looks ok to the indexer, which we will never read. In the past I had proposed adding additional side-information that would enable token filters to map back to original offsets in a consistent way, but that was a bit complex and never got committed. It's been a few years now, so some of the details have grown fuzzy, but I believe something like that is necessary to enable complex token filters to manage offsets in a consistent way. if we end up removing this, we'll almost certainly fork it; maybe nobody else has these problems and that's fine? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
