1

I have a Lucene index created with a custom analyzer/tokenizer combination. The tokenizer adds both CharTermAttribute (although the values are just a lot of numbers) and OffsetAttribute to the index. (If you have a hint how to store numbers and offsets without resorting to CharTermAttribute, that would be really great, I feel a bit bad about this ;))

Now I want to query that index by taking into account the offset of the respective terms. I.e. the first offset is irrelevant but after that the subsequent terms should match the same order, just like PhraseQuery. In a later version, the values should be allowed to diverge a bit. I understand that this may be done using a TermRangeQuery. But I'm still somewhat clueless how to combine these two into achieving what I want.

Can you give me a hint which interface to implement and where to find the required information? I thought it better to ask on SO before digging into the Lucene source...

4

0 回答 0