Package org.appng.api.search
Interface Document
-
- All Superinterfaces:
Comparable<Document>
,Observable<Document>
- All Known Implementing Classes:
SimpleDocument
public interface Document extends Observable<Document>, Comparable<Document>
ADocument
is tracked by the Lucene searchindex. It implementsObservable
so it can notify anObserver
of changes.
A LuceneDocument
is being created from aDocument
instance, which is then being added/updated/deleted from/to the index, depending on theDocumentEvent
passed toDocumentProducer
#put({@link DocumentEvent})
.TODO appng-search is the better place for this
- Author:
- Matthias Müller
- See Also:
DocumentProducer
,DocumentEvent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.appng.api.observe.Observable
Observable.Event
-
-
Field Summary
Fields Modifier and Type Field Description static Observable.Event
CREATE
Event indicating aDocument
has been created.static Observable.Event
DELETE
Event indicating aDocument
has been deleted.static String
FIELD_CONTENT
static String
FIELD_DATE
static String
FIELD_ID
static String
FIELD_IMAGE
static String
FIELD_LANGUAGE
static String
FIELD_PATH
static String
FIELD_TEASER
static String
FIELD_TITLE
static String
FIELD_TYPE
static Observable.Event
UPDATE
Event indicating aDocument
has been updated.static String
YYYY_MM_DD_HH_MM_SS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Iterable<org.apache.lucene.index.IndexableField>
getAdditionalFields()
Returns some additionallyIndexableField
s (if any) to be added to theDocument
which is being created from thisDocument
.String
getContent()
Returns the content to be indexed.Date
getDate()
String
getDescription()
Returns the description of thisDocument
.int
getDocId()
org.apache.lucene.index.IndexableField
getField(String string)
String
getFragment()
String
getId()
String
getImage()
String
getLanguage()
Returns the language of thisDocument
.String
getName()
Returns the name of thisDocument
.String
getPath()
float
getScore()
String
getType()
void
setFragment(String fragment)
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.appng.api.observe.Observable
addObserver, notifyObservers, removeObserver
-
-
-
-
Field Detail
-
FIELD_PATH
static final String FIELD_PATH
- See Also:
- Constant Field Values
-
FIELD_TITLE
static final String FIELD_TITLE
- See Also:
- Constant Field Values
-
FIELD_TEASER
static final String FIELD_TEASER
- See Also:
- Constant Field Values
-
FIELD_IMAGE
static final String FIELD_IMAGE
- See Also:
- Constant Field Values
-
FIELD_DATE
static final String FIELD_DATE
- See Also:
- Constant Field Values
-
FIELD_TYPE
static final String FIELD_TYPE
- See Also:
- Constant Field Values
-
FIELD_LANGUAGE
static final String FIELD_LANGUAGE
- See Also:
- Constant Field Values
-
FIELD_CONTENT
static final String FIELD_CONTENT
- See Also:
- Constant Field Values
-
FIELD_ID
static final String FIELD_ID
- See Also:
- Constant Field Values
-
YYYY_MM_DD_HH_MM_SS
static final String YYYY_MM_DD_HH_MM_SS
- See Also:
- Constant Field Values
-
CREATE
static final Observable.Event CREATE
Event indicating aDocument
has been created.
-
UPDATE
static final Observable.Event UPDATE
Event indicating aDocument
has been updated.
-
DELETE
static final Observable.Event DELETE
Event indicating aDocument
has been deleted.
-
-
Method Detail
-
getId
String getId()
Returns the ID of thisDocument
.
Has to be globally unique, speaking in the scope of aSite
, since each site has it's own searchindex.- Returns:
- the ID
-
getDescription
String getDescription()
Returns the description of thisDocument
.- Returns:
- the description of this
Document
-
getImage
String getImage()
-
getContent
String getContent()
Returns the content to be indexed.- Returns:
- the content to be indexed
-
getType
String getType()
- Returns:
- the type
-
getAdditionalFields
Iterable<org.apache.lucene.index.IndexableField> getAdditionalFields()
Returns some additionallyIndexableField
s (if any) to be added to theDocument
which is being created from thisDocument
.- Returns:
- some
IndexableField
s
-
getField
org.apache.lucene.index.IndexableField getField(String string)
-
getScore
float getScore()
-
getDocId
int getDocId()
-
getFragment
String getFragment()
-
setFragment
void setFragment(String fragment)
-
-