lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentin Popov <valentin...@gmail.com>
Subject multiterm numbers regexp search
Date Mon, 15 Dec 2014 08:45:13 GMT
I have a need to find mastercard numbers with regular expression. 

I’m using Query query = new RegexpQuery(new Term("body", "5{1}<1-5>{1}<0-9>{14}"),
RegExp.ALL) to search numbers in email’s body and StandardAnalizer used for body indexing.
So number like 5106792294698422 will be indexed as it is and all mastercard numbers will be
on search results, but numbers like 5106 7922 9469 8422 will be indexed as 4 tokens 5106,
7922, 9469, 8422, simular for 5106-7922-9469-8422. 

Any ideas how to find the sequence of numbers with spaces, dashes etc? Maybe multiterm regexp
search query? 


Regards,
Valentin Popov





Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message