求助:lucene搜索xml要怎么设定索引

gerbility 2008-05-07
<?xml version='1.0' encoding='utf-8'?>
<address-book>
  <contact type="individual">
    <name>Zane Pasolini</name>
    ... ...
    <telephone>+1 212 345 6789</telephone>
  </contact>
  <contact type="individual">
    <name>...</name>
    ... ...
    <telephone>...</telephone>
  </contact>
</address-book>

要求是搜索xml中的某个字符串时能够得到含有该字符串的contact,里面含有name、telephone的元素的值等等。我现在已经按照书上写了SAXXMLHandler解析xml文档读到document里。
gerbility 2008-05-07
已经知道了,刚刚弄错了。o(∩_∩)o...

相关讨论