本文整理汇总了Java中org.apache.lucene.util.automaton.Automata.makeStringUnion方法的典型用法代码示例。如果您正苦于以下问题:Java Automata.makeStringUnion方法的具体用法?Java Automata.makeStringUnion怎么用?Java Automata.makeStringUnion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.util.automaton.Automata
的用法示例。
在下文中一共展示了Automata.makeStringUnion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toAutomaton
import org.apache.lucene.util.automaton.Automata; //导入方法依赖的package包/类
private Automaton toAutomaton() {
Automaton a = null;
if (include != null) {
a = include.toAutomaton();
} else if (includeValues != null) {
a = Automata.makeStringUnion(includeValues);
} else {
a = Automata.makeAnyString();
}
if (exclude != null) {
a = Operations.minus(a, exclude.toAutomaton(), Operations.DEFAULT_MAX_DETERMINIZED_STATES);
} else if (excludeValues != null) {
a = Operations.minus(a, Automata.makeStringUnion(excludeValues), Operations.DEFAULT_MAX_DETERMINIZED_STATES);
}
return a;
}
示例2: testHugeAutomaton
import org.apache.lucene.util.automaton.Automata; //导入方法依赖的package包/类
public void testHugeAutomaton() {
List<BytesRef> terms = new ArrayList<>();
while (terms.size() < 10000) {
terms.add(new BytesRef(TestUtil.randomUnicodeString(random())));
}
Collections.sort(terms);
new AutomatonQuery(new Term("foo", "bar"), Automata.makeStringUnion(terms), Integer.MAX_VALUE);
}
示例3: makeFilter
import org.apache.lucene.util.automaton.Automata; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
Filter makeFilter(String fname, Iterator<BytesRef> it) {
Automaton union = Automata.makeStringUnion(IteratorUtils.toList(it));
return new MultiTermQueryWrapperFilter<AutomatonQuery>(new AutomatonQuery(new Term(fname), union)) {
};
}
示例4: makeFilter
import org.apache.lucene.util.automaton.Automata; //导入方法依赖的package包/类
@Override
Filter makeFilter(String fname, BytesRef[] byteRefs) {
Automaton union = Automata.makeStringUnion(Arrays.asList(byteRefs));
return new MultiTermQueryWrapperFilter<AutomatonQuery>(new AutomatonQuery(new Term(fname), union)) {
};
}
示例5: makeQuery
import org.apache.lucene.util.automaton.Automata; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
Query makeQuery(String fname, Iterator<BytesRef> it) {
Automaton union = Automata.makeStringUnion(IteratorUtils.toList(it));
return new AutomatonQuery(new Term(fname), union);
}