org.elasticsearch.common.lucene.search.CaseInsensitiveWildcardQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch Show documentation
Show all versions of elasticsearch Show documentation
Elasticsearch subproject :server
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
package org.elasticsearch.common.lucene.search;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.AutomatonQuery;
import static org.elasticsearch.common.lucene.search.AutomatonQueries.toCaseInsensitiveWildcardAutomaton;
/**
* A case insensitive wildcard query.
*/
public class CaseInsensitiveWildcardQuery extends AutomatonQuery {
/**
* Constructs a case insensitive wildcard query.
* @param term the term to search for, created into a case insensitive wildcard automaton
*/
public CaseInsensitiveWildcardQuery(Term term) {
super(term, toCaseInsensitiveWildcardAutomaton(term));
}
public CaseInsensitiveWildcardQuery(Term term, int determinizeWorkLimit, boolean isBinary, RewriteMethod rewriteMethod) {
super(term, toCaseInsensitiveWildcardAutomaton(term), determinizeWorkLimit, isBinary, rewriteMethod);
}
@Override
public String toString(String field) {
return this.getClass().getSimpleName() + "{" + field + ":" + term.text() + "}";
}
}