发布于 2015-07-25 11:31:43 | 104 次阅读 | 评论: 0 | 来源: 网络整理
Query是一个抽象类,包含各种实用方法,所有类型查询的父在Lucene的搜索过程中使用。
以下是org.apache.lucene.search.Query类的声明:
public abstract class Query
extends Object
implements Serializable, Cloneable
| S.N. | 构造函数和说明 |
|---|---|
| 1 | Query() |
| S.N. | 方法及说明 |
|---|---|
| 1 | Object clone() 返回此查询的克隆 |
| 2 | Query combine(Query[] queries) 重新编写在MultiSearcher下查询调用 |
| 3 | Weight createWeight(Searcher searcher) 构造一个适当的 Weight 实现这个查询。 |
| 4 | boolean equals(Object obj) |
| 5 | void extractTerms(Set<Term> terms) Expert: adds all terms occurring in this query to the terms set. |
| 6 | float getBoost() 获取 boost 产生这一条款 |
| 7 | Similarity getSimilarity(Searcher searcher) 不推荐使用。除了使用“runtime”子类/代表团,继承权重来代替 |
| 8 | int hashCode() |
| 9 | static Query mergeBooleanQueries(BooleanQuery... queries) 合并一组 BooleanQuery 条款成一个单一的BooleanQuery |
| 10 | Query rewrite(IndexReader reader) 所谓的重新编写查询到原始查询 |
| 11 | void setBoost(float b) 设置boost此查询子句到 b |
| 12 | String toString() 打印查询字符串 |
| 13 | abstract String toString(String field) 打印查询字符串,字段假定为默认的字段中和省略 |
| 14 | Weight weight(Searcher searcher) 不推荐使用。从来没有使用重量实现此方法。查询的子类应使用createWeight(org.apache.lucene.search.Searcher)来代替。 |
这个类继承了以下类方法:
java.lang.Object