lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kumar, Santosh" <>
Subject Re: Storing and retrieving Java objects in Lucene
Date Tue, 20 Feb 2018 05:53:45 GMT
Hi Ganesh,  Thank you for quick response.
Most of these documents will have more than 10 fields. In some cases there is also a foreign
key relationship. Will consider JSON. Also need to consider performance factor.

Thank you and Regards,

On 20/02/18, 10:00 AM, "ganesh m" <> wrote:

    Hi Santosh
     >>Furthermore converting the Lucene Documents to Java object and vice- 
    versa is a tedious task.
    This should not be tedious, how big your document is?
    One suggestion is to convert your Java object to JSON and store it in 
    Lucene. You need to retrieve one field and you can easily convert back 
    to object.
    On 20-02-2018 08:34, Kumar, Santosh wrote:
    > Hi,
    > 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,
    > Santosh

View raw message