Would it work for you to have multiple entries? This basically just flattens the table relationship you're describing. Use lucene on the phrase and return the id. I'm assuming you have already parsed your list of phrases before this, since you seem to want a very specific kind of look-up.
id text phrase 35 "low pressure engine" 35 "low pressure wheel" 35 "low pressure ..." 42 "high pressure ...." If you expect to delete from and re-add to this index, you may also want a separate field with a unique row id so you can easily identify what to delete/add. On Fri, Apr 29, 2011 at 1:50 AM, juro <[email protected]> wrote: > Hello, > > I need an advice on how to create an document that has parent-child > relationship. Here is an example: > > "low pressure" -> "engine" > -> "wheel" > -> .... > > "low pressure" string is the parent and "engine" and "wheel" are children. > I'd like to be able to search strings such as "low pressure in engine" or > just "low" or "engine" and the result should be an ID of the parent. How do > I create fields in the lucene document to express this relationship? > > Any advice appreciated.-- > View this message in context: > http://lucene.472066.n3.nabble.com/document-with-parent-child-relationship-tp2878314p2878314.html > Sent from the Lucene - General mailing list archive at Nabble.com. >
