- Lucene 入門教程
- Lucene - 主頁
- Lucene - 概覽
- Lucene - 環境設定
- Lucene - 第一個應用程式
- Lucene - 索引類
- Lucene - 搜尋類
- Lucene - 索引程序
- Lucene - 索引操作
- Lucene - 搜尋操作
- Lucene - 查詢程式設計
- Lucene - 分析
- Lucene - 排序
- Lucene 有用資源
- Lucene - 快速指南
- Lucene - 有用資源
- Lucene - 討論
Lucene - TermQuery
TermQuery 是最常用的查詢物件,也是 Lucene 可以利用的許多複雜查詢的基礎。
類宣告
以下是 org.apache.lucene.search.TermQuery 類的宣告 −
public class TermQuery extends Query
類建構函式
下表顯示了一個類建構函式 −
| 序號 | 建構函式和描述 |
|---|---|
| 1 | TermQuery(Term t) 構造針對術語 t 的查詢。 |
類方法
下表顯示了不同的類方法 −
| 序號 | 方法和描述 |
|---|---|
| 1 | void addDocument(Document doc)
將文件新增到此索引。 |
| 2 | Weight createWeight(Searcher searcher)
專家:為該查詢構建合適的 Weight 實現。 |
| 3 | boolean equals(Object o)
當且僅當 o 等於此物件時返回 true。 |
| 4 | void extractTerms(Set<Term> terms)
專家:將此查詢中出現的所有術語新增到術語集合中。 |
| 5 | Term getTerm()
返回此查詢的術語。 |
| 6 | int hashCode()
返回此物件的雜湊碼值。 |
| 7 | String toString(String field)
列印此查詢的使用者可讀版本。 |
繼承的方法
此類繼承了以下類中的方法 −
- org.apache.lucene.search.Query
- java.lang.Object
lucene_searching_classes.htm
廣告