Hi Magne,
         Assuming number of variables will not be large, build 2 indexes

Index 1: contents and documents(variable1 + variable2 + variable3...)
Index 2: documents and variables


Example Query: Get "Survey" where "Variable.label" contains "gender"

Step 1) First query would be to "Index 1" to retrieve all the documents
which contains "gender" in variable "label"

Example Query: Get "Variable" where "Survey.abstract" contains "cancer"
Step 1) First query will be to "Index 1" to retrieve all the documents
which contains "cancer" in variable "abstract"
Step 2) Second query will be to retrieve all variables containing
documents retrieved from Step 1


Rajesh Munavalli  

-----Original Message-----
From: Magne Skjeret [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 25, 2005 9:41 AM
To: java-user@lucene.apache.org
Subject: Relations between documents

Hi

I have been reading around a bit on the net to find a solution for my
problem, but no luck yet. I am pretty sure it can be done, but I haven't
found out how yet.

My problem is that I have relations between documents.

E.g
   Survey --> Variables

   Each survey can have loads of variables, and I want to be able to run
queries like this:

Get Survey where Variable.label contains 'gender'
Get Variable where Survey.abstract contains 'cancer'

Is this possible to do this in the index? Or does it belong in the
query?

If anyone has some comments on best practice or other comments I would
very much appreciate hearing about them.

Magne Skjeret








---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to