You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by sv...@gmail.com on 2011/04/29 09:29:06 UTC
document with parent-child relationship
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.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: document with parent-child relationship
Posted by harsh srivastava <ha...@gmail.com>.
Hi,
You can create three fields for a document to index e.g.
Fields => parent_id parent_text child_text
Contents => 1 low pressure engine wheel,
etc
2 Electronics laptop
pc ...
Hope it helps.
Harsh
On Fri, Apr 29, 2011 at 12:59 PM, <sv...@gmail.com> 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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>