本文整理汇总了Java中org.elasticsearch.index.query.QueryStringQueryBuilder.analyzer方法的典型用法代码示例。如果您正苦于以下问题:Java QueryStringQueryBuilder.analyzer方法的具体用法?Java QueryStringQueryBuilder.analyzer怎么用?Java QueryStringQueryBuilder.analyzer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.index.query.QueryStringQueryBuilder
的用法示例。
在下文中一共展示了QueryStringQueryBuilder.analyzer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: urlParamsToQueryBuilder
import org.elasticsearch.index.query.QueryStringQueryBuilder; //导入方法依赖的package包/类
public static QueryBuilder urlParamsToQueryBuilder(RestRequest request) {
String queryString = request.param("q");
if (queryString == null) {
return null;
}
QueryStringQueryBuilder queryBuilder = QueryBuilders.queryStringQuery(queryString);
queryBuilder.defaultField(request.param("df"));
queryBuilder.analyzer(request.param("analyzer"));
queryBuilder.analyzeWildcard(request.paramAsBoolean("analyze_wildcard", false));
queryBuilder.lenient(request.paramAsBoolean("lenient", null));
String defaultOperator = request.param("default_operator");
if (defaultOperator != null) {
queryBuilder.defaultOperator(Operator.fromString(defaultOperator));
}
return queryBuilder;
}
示例2: parseQuerySource
import org.elasticsearch.index.query.QueryStringQueryBuilder; //导入方法依赖的package包/类
public static QuerySourceBuilder parseQuerySource(RestRequest request) {
String queryString = request.param("q");
if (queryString == null) {
return null;
}
QueryStringQueryBuilder queryBuilder = QueryBuilders.queryStringQuery(queryString);
queryBuilder.defaultField(request.param("df"));
queryBuilder.analyzer(request.param("analyzer"));
queryBuilder.analyzeWildcard(request.paramAsBoolean("analyze_wildcard", false));
queryBuilder.lowercaseExpandedTerms(request.paramAsBoolean("lowercase_expanded_terms", true));
queryBuilder.lenient(request.paramAsBoolean("lenient", null));
String defaultOperator = request.param("default_operator");
if (defaultOperator != null) {
if ("OR".equals(defaultOperator)) {
queryBuilder.defaultOperator(QueryStringQueryBuilder.Operator.OR);
} else if ("AND".equals(defaultOperator)) {
queryBuilder.defaultOperator(QueryStringQueryBuilder.Operator.AND);
} else {
throw new IllegalArgumentException("Unsupported defaultOperator [" + defaultOperator + "], can either be [OR] or [AND]");
}
}
return new QuerySourceBuilder().setQuery(queryBuilder);
}
示例3: fullParamer
import org.elasticsearch.index.query.QueryStringQueryBuilder; //导入方法依赖的package包/类
public static ToXContent fullParamer(QueryStringQueryBuilder query, Paramer paramer) {
if (paramer.analysis != null) {
query.analyzer(paramer.analysis);
}
if (paramer.boost != null) {
query.boost(paramer.boost);
}
return query;
}
示例4: fullParamer
import org.elasticsearch.index.query.QueryStringQueryBuilder; //导入方法依赖的package包/类
public static ToXContent fullParamer(QueryStringQueryBuilder query, Paramer paramer) {
if (paramer.analysis != null) {
query.analyzer(paramer.analysis);
}
if (paramer.boost != null) {
query.boost(paramer.boost);
}
return query;
}
示例5: fullParamer
import org.elasticsearch.index.query.QueryStringQueryBuilder; //导入方法依赖的package包/类
public static ToXContent fullParamer(QueryStringQueryBuilder query, Paramer paramer) {
if (paramer.analysis != null) {
query.analyzer(paramer.analysis);
}
if (paramer.boost != null) {
query.boost(paramer.boost);
}
if (paramer.slop != null) {
query.phraseSlop(paramer.slop);
}
return query;
}