【发布时间】:2011-07-04 11:46:13
【问题描述】:
我需要使用 Apache Lucene 和 Commons Digester 构建基于 XML 的查询。
我的文档格式如下:
<doc>
<id>361492799</id>
<title>Dan1</title>
<description>We had another Flickr meetup in Rochester, the biggest that Ive been to. 12 people showed up.Da, he was to the right.</description>
<time>18934934</time>
<tags>flickrmeetup rochester dan totheright 200701</tags>
<geo><latitude>324234</latitude><longitude>28342349</longitude></geo>
<event>135961</event>
</doc>
而且查询实际上也是一个文档,我需要与整个集合进行比较。每个属性都有不同的相似度度量。例如,“描述”具有 tf-idf 余弦相似度。 “时间”只是差值,“纬度”+“经度”使用半正弦距离进行比较。
目前我只使用简单的文本查询(例如“word1 word2”)执行搜索。我该如何构建更复杂的查询?
谢谢
【问题讨论】:
标签: java lucene apache-commons-digester