Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8359551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:10:46+00:00 2026-06-09T11:10:46+00:00

I am following closely to a Lucene Tutorial with Lucene 3.6. I am able

  • 0

I am following closely to a Lucene Tutorial with Lucene 3.6.

I am able to create and perform searches on Document objects, but I would like to get back the original objects I used to create the Documents. Unfortunately, Lucene seems to be serialising/deserialising the Documents, so I have not been able to create a lookup map between them.

How do I keep a relationship between Lucene’s Documents and my Objects? Is there a preferred Lucene way of doing this?

I should note that the tutorial didn’t work out of the box for me, I had to add a call to IndexWriter.commit() after creating/attaching the Documents and I also have to make calls to IndexWriterConfig.setMaxBufferedDocs() and IndexWriterConfig.setRAMBufferSizeMB() with big numbers to stop Lucene looking on the hard drive.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:10:47+00:00Added an answer on June 9, 2026 at 11:10 am

    First, you need a unique reference to the original object. If your objects are rows in a database, you might go with the primary key, let’s assume, it is a unique ID.

    Secondly, when creating the searchable Documents, just add a field like

    doc.add(new Field("id", object.getId().toString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
    

    You can later retrieve this field from the found documents and retrieve the original document (database entry) based on the id.

    If you may have different document types, e.g. database entries and PDFs, just save the document type in the same manner, allowing you to handle the different types differently.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am following the documentation as closely as I can, but I can't get
I would like to use python read and write files of the following format:
I would like to run the following code (below). I want to spawn two
I'm building a custom print template closely following the directions in Chuck Ainslie's articles
Following code takes like 2500 milliseconds on an i7-*3.4 GHz windows-7 64-bit computer to
Following chunk html code works as expected: <iframe src=http://www.amazon.com/></iframe> But when trying embed inner
Following on from my previous question: Simple inner join in linq How would I
I have been following the ExtDirectSpring form posting guide closely. I defined an api
I have a join table with the following structure: CREATE TABLE adjectives_friends ( adjective_id
I'm using the following piece of codes to create a new contact. It follow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.