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 Kai Hu <ka...@dusee.cn> on 2007/08/10 04:53:55 UTC
答复: Nested Fields
Hi, Spencer
Why not translating a xml to an object when indexing,and translating the object to a xml when searching.
kai
-----邮件原件-----
发件人: Spencer Tickner [mailto:spencertickner@gmail.com]
发送时间: 2007年8月4日 星期六 6:01
收件人: java-user@lucene.apache.org
主题: Nested Fields
Hi, and thanks in advace for any help.
I'm fairly new to lucene so excuse the ignorance. I'm attempting to
field an XML documents with nested fields. So:
<foo>
<bar>This</bar>
<bat>That</bat>
</foo>
would give me hits for:
bar:This
bat:That
foo:ThisThat
The only way I can see a way of doing this now is to field each
element I want to field and all of it's descendant text, repeating the
same text multiple times for nested fields, then finally have a <root>
field that would field the text for all the document so users not
doing field searches would programmically be forced to search on
<root> to not get multiple hits. This seems inefficent to me and am
hopeing that someone has some advice or can point me to a better way.
Thanks,
Spencer
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org