本文整理汇总了Java中org.apache.lucene.queryparser.flexible.standard.config.FuzzyConfig类的典型用法代码示例。如果您正苦于以下问题:Java FuzzyConfig类的具体用法?Java FuzzyConfig怎么用?Java FuzzyConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FuzzyConfig类属于org.apache.lucene.queryparser.flexible.standard.config包,在下文中一共展示了FuzzyConfig类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getFuzzyMinSim
点赞 2
import org.apache.lucene.queryparser.flexible.standard.config.FuzzyConfig; //导入依赖的package包/类
/**
* Get the minimal similarity for fuzzy queries.
*/
@Override
public float getFuzzyMinSim() {
FuzzyConfig fuzzyConfig = getQueryConfigHandler().get(ConfigurationKeys.FUZZY_CONFIG);
if (fuzzyConfig == null) {
return FuzzyQuery.defaultMinSimilarity;
} else {
return fuzzyConfig.getMinSimilarity();
}
}
开发者ID:lamsfoundation,
项目名称:lams,
代码行数:14,
代码来源:StandardQueryParser.java
示例2: getFuzzyPrefixLength
点赞 2
import org.apache.lucene.queryparser.flexible.standard.config.FuzzyConfig; //导入依赖的package包/类
/**
* Get the prefix length for fuzzy queries.
*
* @return Returns the fuzzyPrefixLength.
*/
@Override
public int getFuzzyPrefixLength() {
FuzzyConfig fuzzyConfig = getQueryConfigHandler().get(ConfigurationKeys.FUZZY_CONFIG);
if (fuzzyConfig == null) {
return FuzzyQuery.defaultPrefixLength;
} else {
return fuzzyConfig.getPrefixLength();
}
}
开发者ID:lamsfoundation,
项目名称:lams,
代码行数:16,
代码来源:StandardQueryParser.java
示例3: preProcessNode
点赞 2
import org.apache.lucene.queryparser.flexible.standard.config.FuzzyConfig; //导入依赖的package包/类
@Override
protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException {
if (node instanceof FuzzyQueryNode) {
FuzzyQueryNode fuzzyNode = (FuzzyQueryNode) node;
QueryConfigHandler config = getQueryConfigHandler();
FuzzyConfig fuzzyConfig = null;
if (config != null && (fuzzyConfig = config.get(ConfigurationKeys.FUZZY_CONFIG)) != null) {
fuzzyNode.setPrefixLength(fuzzyConfig.getPrefixLength());
if (fuzzyNode.getSimilarity() < 0) {
fuzzyNode.setSimilarity(fuzzyConfig.getMinSimilarity());
}
} else if (fuzzyNode.getSimilarity() < 0) {
throw new IllegalArgumentException("No FUZZY_CONFIG set in the config");
}
}
return node;
}
开发者ID:lamsfoundation,
项目名称:lams,
代码行数:26,
代码来源:FuzzyQueryNodeProcessor.java