I need to search through lucene.net document contains spaces between letters.
example
Document 1: 54 658 1 22
Document 2: 54658 122
Document 3: 5 4658122
Query: 54658122
I need to return all documents that contain the query in the example is all the documents.
Thanks
When storing the data in the Lucene index, store a document field where the spaces have been removed from the source data – and index that field. When searching, strip the spaces and search on the field without spaces. If the spaces are important in the output, I recommend you also the original data in a separate field of the Lucene document. That way, you can use it for user display after finding the documents with the other field.