I would like to use Lucene for indexing a table in an existing database. I have been thinking the process is like:
- Create a 'Field' for every column in the table
- Store all the Fields
- 'ANALYZE' all the Fields except for the Field with the primary key
- Store each row in the table as a Lucene Document.
While most of the columns in this table are small in size, one is huge. This column is also the one containing the bulk of the data on which searches will be performed.
I know Lucene provides an option to not store a Field. I was thinking of two solutions:
- Store the field regardless of the size and if a hit is found for a search, fetch the appropriate Field from Document
- Don't store the Field and if a hit is found for a search, query the data base to get the relevant information out
I realize there may not be a one size fits all answer ...