文檔表示一個(gè)虛擬文檔與字段,其中字段是可包含在物理文檔的內(nèi)容,它的元數(shù)據(jù)等的對(duì)象。Analyzer只能理解文檔。
以下是 org.apache.lucene.document.Document 類的聲明:
public final class Document extends Object implements Serializable
| S.N. | 構(gòu)造函數(shù)和說(shuō)明 |
|---|---|
| 1 |
Document() Constructs a new document with no fields. |
| S.N. | 方法及說(shuō)明 |
|---|---|
| 1 |
void clearLock(String name) 嘗試清除(強(qiáng)行解鎖和刪除)指定的鎖 |
| 2 |
void add(Fieldable field) 增加一個(gè)字段到一個(gè)文檔。 |
| 3 |
String get(String name) 如果存在這個(gè)文件,返回給定名稱的字段的字符串值或者null。 |
| 4 |
byte[] getBinaryValue(String name) 返回第一個(gè)(或唯一)字段中具有指定為方法參數(shù)的名稱的字節(jié)數(shù)組。 |
| 5 |
byte[][] getBinaryValues(String name) 返回字節(jié)陣列為具有指定為方法參數(shù)的名稱的字段的數(shù)組。 |
| 6 |
float getBoost() 返回時(shí),在索引時(shí)間,增強(qiáng)因子由setBoost(float)設(shè)置 |
| 7 |
Field getField(String name) 不推薦使用。使用getFieldable(java.lang.String) ,構(gòu)造根據(jù)數(shù)據(jù)類型。 |
| 8 |
Fieldable getFieldable(String name) 如果存在這個(gè)文件,返回一個(gè)字段的名字或者為null |
| 9 |
Fieldable[] getFieldables(String name) 返回Fieldables給定的名稱的數(shù)組 |
| 10 |
List<Fieldable> getFields() 返回所有文檔中的字段列表 |
| 11 |
Field[] getFields(String name) 不推薦使用。使用getFieldable(java.lang.String) ,根據(jù)數(shù)據(jù)類型構(gòu)造 |
| 12 |
String[] getValues(String name) 返回指定為方法參數(shù)字段的值的數(shù)組 |
| 13 |
void removeField(String name) 去除字段中文檔中指定的名稱 |
| 14 |
void removeFields(String name) 從文檔刪除指定名稱的所有字段 |
| 15 |
void setBoost(float boost) 設(shè)置這個(gè)文件的任何字段命中因素 |
| 16 |
String toString() 打印供消費(fèi)的文檔域 |
這個(gè)類從以下類繼承的方法:
java.lang.Object