Not sure if it's too late for you. But here are my comments if you
want to stick with Hibernate and Hibernate Search
Generally speaking, once you have the query to retrieve the data per
id, you can map this query to an entity in Hibernate using either:
- @Formula for simple cases
- @Loader
What the other posters are referring to is that you will have to
probably write some java code to do lucene indexing: you can get
access to your model objects (with all their dependent data) in java.
- since you are using hibernate, this shouild be easy- then create
lucene documents from your mode
Sorry, sent the previous draft email by mistake. Here is the correct one.
Sounds a typical SQL pivot problem.
select Id, SIN, data.*
from IdCard, (SELECT
ID
MAX(CASE WHEN name = 'Fname' THEN Value END) AS Fname,
MAX(CASE WHEN name = 'Lname' THEN Value END) AS Lname,
MAX(CA
Thanks for your reply.
Your idea prompts more questions:
I understand what you are saying but don't know how to implement it. How do
you go about joining all rows of all the tables belonging to one person and
to index them so that I can actually use
"+Fname:john +County:USA" as a query?
Eric
To expand a bit on Chris's first point: Take off your DB hat and put on
your search hat . It sounds like you have simply moved your database
tables into Lucene and want to search across them. My rule is that
whenever you find yourself trying to make Lucene act like a DB, you
need to pause and refle
Hi, lmctndi,
You can liberate yourself from this complicated schema, and use some
SQLs to select out the content and put the data into one Lucene index.
You may need to avoid Hibernate Search here for your case, which limit
you to one way of organizing Lucene indexes. I do think this is where
DBS