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

  • Home
  • SEARCH
  • 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 750617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:34:17+00:00 2026-05-14T14:34:17+00:00

Basically I do have pretty simple database that I’d like to index with Lucene.

  • 0

Basically I do have pretty simple database that I’d like to index with Lucene.
Domains are:

// Person domain
class Person {
  Set<Pair> keys;
}

// Pair domain
class Pair {
  KeyItem keyItem;
  String value;
}

// KeyItem domain, name is unique field within the DB (!!)
class KeyItem{
  String name;
}

I’ve tens of millions of profiles and hundreds of millions of Pairs, however, since most of KeyItem’s “name” fields duplicates, there are only few dozens KeyItem instances.
Came up to that structure to save on KeyItem instances.

Basically any Profile with any fields could be saved into that structure.
Lets say we’ve profile with properties

- name: Andrew Morton
- eduction:  University of New South Wales, 
- country: Australia, 
- occupation: Linux programmer.

To store it, we’ll have single Profile instance, 4 KeyItem instances: name, education,country and occupation, and 4 Pair instances with values: “Andrew Morton”, “University of New South Wales”, “Australia” and “Linux Programmer”.

All other profile will reference (all or some) same instances of KeyItem: name, education, country and occupation.

My question is, how to index all of that so I can search for Profile for some particular values of KeyItem::name and Pair::value. Ideally I’d like that kind of query to work:

name:Andrew* AND occupation:Linux*

Should I create custom Indexer and Searcher? Or I could use standard ones and just map KeyItem and Pair as Lucene components somehow?

  • 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-05-14T14:34:18+00:00Added an answer on May 14, 2026 at 2:34 pm

    I believe you can use standard Lucene methodology.
    I would:

    • Translate every profile to a Lucene Document.
    • Translate every Pair to a Field in this Document. All Fields need to be indexed, but not necessarily stored.
    • Add a stored Field with a profile id to the Document.
    • Search using name:value pairs similarly to your example.

    If you choose bare Lucene, you will need a custom Indexer and Searcher, but they are not hard to build.
    It may be easier for you to use Solr, where you need less programming. However, I do not know if Solr allows an open-ended schema like the one I described – I believe you have to predefine all field names, so this may prevent you from using Solr.

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

Sidebar

Related Questions

Basically I have a small template that looks like: <xsl:template name=templt> <xsl:param name=filter />
I have a simple Class Hierarchy that I am trying to get to work
I would like to do the following. Basically have a stored procedure call another
Basically I have the following class: class StateMachine { ... StateMethod stateA(); StateMethod stateB();
I have a pretty standard contact form that uses a cfc for processing now.
I'm looking to add a pretty simple SQLite database to an existing Java EE
I have been trying to figure out what I figure is a pretty simple
I'm trying to make a pretty simple game and I'm stuck. Basically I want
I basically have a page which shows a processing screen which has been flushed
I basically have the following flow: XML -> JSON -> Spring MVC -> jsp

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.