我正在测试 Lucene.NET 是否满足我们的搜索要求,我有几个问题。
我们有 XML 格式的文档。每个文档都包含多语言文本。语言的数量和语言本身因文档而异。请参见下面的示例:
<document>This is a sample document, which is describing a <word lang="de">tisch</word>, a <word lang="en">table</word> and a <word lang="en">desk</word>.</document>
文档的关键字使用特殊元素和语言属性进行标记。
当我创建 lucene 索引时,我从 XML 以及语言和关键字对中提取文本内容(我不确定是否必须这样做),如下所示:
This is a sample document, which is describing a tisch, a table and a desk.
de - tisch
en - table
en - desk
我不确切知道如何创建一个可以搜索的索引,例如: - 所有包含德语单词 tisch 的文档(而不是包含其他语言单词 tisch 的文档)。
而且我想在运行时指定排序:我想按用户指定的语言顺序排序(取决于用户界面)。例如,如果我们有两个文档:
<document>This is a sample document, which is describing a <word lang="de">tisch</word>.</document>
<document>This is a another sample document, which is describing a <word lang="en">table</word>.</document>
英文界面上的用户通过“tisch OR table”搜索我想先得到第二个结果。
任何信息或建议表示赞赏。
非常感谢!