我正在测试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>
和“蒂施或表”上的英文界面的用户搜索我想先拿到第二个结果。
的任何信息或建议表示赞赏。
非常感谢!