I have a requirement to store a Java object with multiple fields into the 
Lucene index. Basically, at the application startup I run a  select query on 
entities ( there are 5 of them as of now and may increase in future) and then 
create an index for each of these entities (5) i.e. five different indexes as 
of now(cannot have a common index. Need separation of entity data).   Ideally I 
would have liked to store only primary key field, but I need rest of the fields 
upon fetch.
I use this index(basically only the primary key field) to prevent users from 
creating duplicate entities or suggest them like a Did you mean(Google) ? 
feature . For this purpose, I’m using SpellChecker module to suggest entities 
or identify duplicates. Since, Spell checker only returns a String array, I 
again have to run a select separate search on the index(QueryParser search) or 
run select on the DB to fetch the entire object. Furthermore converting the 
Lucene Documents to Java object and vice- versa is a tedious task. Is there any 
API or library that can simplify this task ?  I have heard of Compass API, but 
not sure if it is still recommended. Any examples of the same or APIs will be 
appreciated. Thank you !!!

Thank you and Regards,

Reply via email to