本文整理汇总了Java中org.apache.solr.schema.FieldType.isTokenized方法的典型用法代码示例。如果您正苦于以下问题:Java FieldType.isTokenized方法的具体用法?Java FieldType.isTokenized怎么用?Java FieldType.isTokenized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.schema.FieldType
的用法示例。
在下文中一共展示了FieldType.isTokenized方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFieldQuery
import org.apache.solr.schema.FieldType; //导入方法依赖的package包/类
protected Query getFieldQuery(String field, String queryText, boolean quoted) throws SyntaxError {
checkNullField(field);
// intercept magic field name of "_" to use as a hook for our
// own functions.
if (field.charAt(0) == '_' && parser != null) {
MagicFieldName magic = MagicFieldName.get(field);
if (null != magic) {
subQParser = parser.subQuery(queryText, magic.subParser);
return subQParser.getQuery();
}
}
SchemaField sf = schema.getFieldOrNull(field);
if (sf != null) {
FieldType ft = sf.getType();
// delegate to type for everything except tokenized fields
if (ft.isTokenized() && sf.indexed()) {
return newFieldQuery(getAnalyzer(), field, queryText, quoted || (ft instanceof TextField && ((TextField)ft).getAutoGeneratePhraseQueries()));
} else {
return sf.getType().getFieldQuery(parser, sf, queryText);
}
}
// default to a normal field query
return newFieldQuery(getAnalyzer(), field, queryText, quoted);
}
示例2: getFieldQuery
import org.apache.solr.schema.FieldType; //导入方法依赖的package包/类
protected Query getFieldQuery(String field, String queryText, boolean quoted) throws SyntaxError {
checkNullField(field);
// intercept magic field name of "_" to use as a hook for our
// own functions.
if (field.charAt(0) == '_' && parser != null) {
MagicFieldName magic = MagicFieldName.get(field);
if (null != magic) {
subQParser = parser.subQuery(queryText, magic.subParser);
return subQParser.getQuery();
}
}
SchemaField sf = schema.getFieldOrNull(field);
if (sf != null) {
FieldType ft = sf.getType();
// delegate to type for everything except tokenized fields
if (ft.isTokenized() && sf.indexed()) {
return newFieldQuery(analyzer, field, queryText, quoted || (ft instanceof TextField && ((TextField)ft).getAutoGeneratePhraseQueries()));
} else {
return sf.getType().getFieldQuery(parser, sf, queryText);
}
}
// default to a normal field query
return newFieldQuery(analyzer, field, queryText, quoted);
}