I have an application that is indexing the text from various reports and forms 
that are generated from our core system.  The reports will contain dollar 
amounts and various indexes that contain all numbers, but have leading zeros.

If a document contains that following text that is stored in one Lucene 
document field:

"Account 00000012345 owes $321.98"

What analyzer can be used to index this text and allow the user to find this 
document by searching on:

12345

OR

321

???

We are currently using a StandardAnalyzer which works well for most of our use 
cases, but not one like this.

I realize that I could create my own token filter to convert any text that can 
be represented by an Integer or Long, with leading zeros or not, and convert 
the value to a normal looking integer without leading zeros.  But I'd prefer to 
reuse and existing analyzer or technique to achieve the same results.

Thank you.


Reply via email to