|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Document
A document abstraction for the search engine. This interface is meant to be used as a way for an application to retrieve (some) of the contents of a document out of the index, make some modifications to the index and then resubmit the document to the index.
Note that this representation of a document will contain only the fields that
have the SAVED
and VECTORED
attributes set. Data
that was indexed, but not vectored cannot be recovered for such a representation.
SearchEngine.getDocument(java.lang.String)
,
FieldInfo
Method Summary | |
---|---|
java.lang.String |
getKey()
Gets the key associated with this document. |
java.util.Iterator<java.util.Map.Entry<java.lang.String,java.util.List<Posting>>> |
getPostings()
Gets an iterator for the vectored fields in this document. |
java.util.List<Posting> |
getPostings(java.lang.String field)
Gets the list of postings associated with a given field. |
java.util.List<java.lang.Object> |
getSavedField(java.lang.String field)
Gets the values of a given saved field from the index. |
java.util.Iterator<java.util.Map.Entry<java.lang.String,java.util.List>> |
getSavedFields()
Gets an iterator for all of the saved field values in a document. |
void |
setKey(java.lang.String key)
Sets the key for this document. |
void |
setPostings(java.lang.String field,
java.util.List<Posting> postings)
Sets the list of postings associated with a given field. |
void |
setSavedField(java.lang.String field,
java.util.List values)
Sets the values of a saved field. |
Method Detail |
---|
java.lang.String getKey()
void setKey(java.lang.String key)
key
- the key for the documentjava.util.List<java.lang.Object> getSavedField(java.lang.String field)
field
- the name of the saved field whose values should be retrieved.
java.lang.IllegalArgumentException
- if the given field is not the name of a
saved field.java.util.Iterator<java.util.Map.Entry<java.lang.String,java.util.List>> getSavedFields()
void setSavedField(java.lang.String field, java.util.List values)
field
- the name of the saved field whose values should be set.values
- a list of values to assign to the saved field. These values
should be of a type appropriate to the saved field.
java.lang.IllegalArgumentException
- if the named field is not a saved field.SearchEngine.index(Document)
java.util.List<Posting> getPostings(java.lang.String field)
field
- the name of a field that was indexed and vectored. If this
value is null
then the postings returned are for terms that
were not added to any explicit field.
java.lang.IllegalArgumentException
- if the named field is not a vectored
field.java.util.Iterator<java.util.Map.Entry<java.lang.String,java.util.List<Posting>>> getPostings()
void setPostings(java.lang.String field, java.util.List<Posting> postings)
field
- the name of the field whose postings should be modified.
If this
value is null
then the postings will be used for the default
unnamed field.postings
- a list of postings to associate with the field. If the
named field has no postings for this field, then an empty list is returned.
java.lang.IllegalArgumentException
- if the named field is not a
vectored field.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |