public final class DocumentItem extends Schema<DocumentItem>
This schema is used to create indexes for document items.
It supports index fields author, documentCategory,
size, path, content, and all the fields in CommonItem.
Among these fields, identifier is mandatory and can be set via the
CommonItem#setIdentifier(String) method.
SystemCapability.Data#DATA_SEARCH| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static String |
AUTHOR |
Indicates the index field name of
author. |
static String |
CONTENT |
Indicates the index field name of
content. |
static String |
DOCUMENT_CATEGORY |
Indicates the index field name of
documentCategory. |
static String |
PATH |
Indicates the index field name of
path. |
static String |
SIZE |
Indicates the index field name of
size. |
| 构造器 | 说明 |
|---|---|
DocumentItem() |
A constructor used to create a
DocumentItem instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
getAuthor() |
Obtains the value of the
author index field. |
String |
getContent() |
Obtains the value of the
content index field. |
String |
getDocumentCategory() |
Obtains the value of the
documentCategory index field. |
static List<IndexForm> |
getDocumentSchema() |
Obtains a list of index field attributes in this
DocumentItem object. |
String |
getPath() |
Obtains the value of the
path index field. |
Integer |
getSize() |
Obtains the value of the
size index field. |
DocumentItem |
setAuthor(String author) |
Sets the
author index field. |
DocumentItem |
setContent(String content) |
Sets the
content index field. |
DocumentItem |
setDocumentCategory(String documentCategory) |
Sets the
documentCategory index field. |
DocumentItem |
setPath(String path) |
Sets the
path index field. |
DocumentItem |
setSize(Integer size) |
Sets the
size index field. |
clear, get, getAsDouble, getAsFloat, getAsInteger, getAsLong, getAsString, getValues, isEmpty, put, put, put, put, put, remove, setValues, sizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAlternateName, getCategory, getDateCreate, getDescription, getIdentifier, getKeywords, getName, getPotentialAction, getReserved1, getReserved2, getSubtitle, getThumbnailUrl, getTitle, getUrl, setAlternateName, setCategory, setDateCreate, setDescription, setIdentifier, setKeywords, setName, setPotentialAction, setReserved1, setReserved2, setSubtitle, setThumbnailUrl, setTitle, setUrlpublic static final String AUTHOR
author.public static final String CONTENT
content.public static final String DOCUMENT_CATEGORY
documentCategory.public DocumentItem()
DocumentItem instance.public static List<IndexForm> getDocumentSchema()
DocumentItem object.public DocumentItem setAuthor(String author)
author index field.
Attributes of this index field:
IndexForm.indexFieldName = "author";
IndexForm.indexType = IndexType.ANALYZED;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = true;
IndexForm.isSearch = true;
author - Indicates the document author.DocumentItem object.public DocumentItem setDocumentCategory(String documentCategory)
documentCategory index field.
Attributes of this index field:
IndexForm.indexFieldName = "documentCategory";
IndexForm.indexType = IndexType.SORTED;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = true;
IndexForm.isSearch = true;
documentCategory - Indicates the document category.DocumentItem object.public DocumentItem setSize(Integer size)
size index field.
Attributes of this index field:
IndexForm.indexFieldName = "size";
IndexForm.indexType = IndexType.NO;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = true;
IndexForm.isSearch = false;
size - Indicates the document size.DocumentItem object.public DocumentItem setContent(String content)
content index field.
Attributes of this index field:
IndexForm.indexFieldName = "content";
IndexForm.indexType = IndexType.ANALYZED;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = false;
IndexForm.isSearch = true;
content - Indicates the document content.DocumentItem object.public DocumentItem setPath(String path)
path index field.
Attributes of this index field:
IndexForm.indexFieldName = "path";
IndexForm.indexType = IndexType.NO;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = true;
IndexForm.isSearch = false;
path - Indicates the document path.DocumentItem object.public String getAuthor()
author index field.author index field.public String getDocumentCategory()
documentCategory index field.documentCategory index field.public Integer getSize()
size index field.size index field.public String getContent()
content index field.content index field.public String getPath()
path index field.path index field.