使用Lucene.net索引多语言内容 [英] Indexing multi-lingual content with Lucene.net

查看:73
本文介绍了使用Lucene.net索引多语言内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Lucene.net 为内容编入索引&网站上的文档等.索引非常简单,并具有以下格式:

I use Lucene.net for indexing content & documents etc.. on websites. The index is very simple and has this format:


LuceneId - unique id for Lucene (TypeId + ItemId)
TypeId   - the type of text (eg. page content, product, public doc etc..)
ItemId   - the web page id, document id etc..
Text     - the text indexed
Title    - web page title, document name etc.. to display with the search results

我有以下选择,可以使其适应多种语言的内容:

I've got these options to adapt it to serve multi-lingual content:

  1. 为每种语言创建一个单独的索引.例如. Lucene-enGB,Lucene-frFR等.
  2. 保留一个索引,并向其添加一个附加的语言"字段以过滤结果.

哪个是最佳选择-还是还有另一个?我之前没有使用过多个索引,所以我倾向于第二个.

Which is the best option - or is there another? I've not used multiple indexes before so I'm leaning toward the second.

推荐答案

我做了[2],但是我遇到的一个问题是,根据语言的不同,我不能使用不同的分析器.我已经合并了我想要的语言的停用词,但是我却失去了分析器将提供的更高级的功能,例如词干分析等.

I do [2], but one problem I have is that I cannot use different analyzers depending on the language. I've combined the stopwords of the languages I want, but I lose the capability of more advanced stuff that the analyzer will offer such as stemming etc.

这篇关于使用Lucene.net索引多语言内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆