Solr的TermsComponent:通配符的使用 [英] Solr TermsComponent: Usage of wildcards
问题描述
我使用Solr的1.4.1,我愿意用TermsComponent为自动完成。问题是,我不能让它匹配带空格的字符串。这么说来,
I'm using Solr 1.4.1 and I'm willing to use TermsComponent for AutoComplete. The problem is, I can't get it to match strings with spaces in them. So to say,
<$c$c>terms.fl=name&terms.lower=david&terms.$p$pfix=david&terms.lower.incl=false&indent=true&wt=json$c$c>
开头为大卫的所有字符串匹配,但如果我将其更改为:
matches all strings starting with "david" but if I change it to:
<$c$c>terms.fl=name&terms.lower=david%20&terms.$p$pfix=david%20&terms.lower.incl=false&indent=true&wt=json$c$c>
不匹配开头为大卫的所有字符串。难道意思是这样呢?如果是这样,正克要走的路?并没有任何人知道,如果TermsComponent正在实施或尝试次数或DAWGs树木Raddix,如果它是有效的?
it doesn't match all strings starting with "david ". Is it meant to be that way? If so, are n-grams the way to go? And does anybody know if TermsComponent is implementing Tries or DAWGs or Raddix trees and if it's efficient?
干杯,结果
帕尔萨
Cheers,
Parsa
推荐答案
据我所知TermsComponent提供的原始(即字面)获取字段的条件,因此,如果没有空间的任何条款(通常没有,标记者注意到这一照顾),它不会匹配任何空白。 TermsComponent没有实现试或任何东西,它只是列举条款在该领域的索引。
AFAIK TermsComponent provides raw (i.e. literal) access to the fields' terms, so if there isn't any term with space (normally there isn't, the whitespace tokenizer takes care of that) it won't match anything. TermsComponent doesn't implement tries or anything, it just enumerates terms in the field index.
恕我直言n元组是自动完成一个更灵活的解决方案。
IMHO ngrams are a more flexible solution for autocomplete.
的Solr的下一个版本将有一个特定组件来实现自动提示(如果您使用每晚构建),你现在可以使用它
The next release of Solr will have a specific component to implement autosuggest (you could use it now if you use nightly builds)
这篇关于Solr的TermsComponent:通配符的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!