|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.search.CmsSearchResult
public class CmsSearchResult
Contains the data of a single item in a search result.
Field Summary | |
---|---|
protected java.util.Date |
m_dateCreated
The creation date of this search result. |
protected java.util.Date |
m_dateLastModified
The last modification date of this search result. |
protected java.lang.String |
m_documentType
The document type of the search result. |
protected java.lang.String |
m_excerpt
The excerpt of this search result. |
protected java.lang.String |
m_path
The resource path of this search result. |
protected int |
m_score
The score of this search result. |
Constructor Summary | |
---|---|
CmsSearchResult(int score,
org.apache.lucene.document.Document doc,
java.lang.String excerpt)
Creates a new search result. |
Method Summary | |
---|---|
int |
compareTo(CmsSearchResult obj)
|
boolean |
equals(java.lang.Object obj)
|
java.util.Date |
getDateCreated()
Returns the date created. |
java.util.Date |
getDateLastModified()
Returns the date last modified. |
java.lang.String |
getDescription()
Deprecated. use getField(String) instead with the name of the field,
for example use CmsSearchField.FIELD_DESCRIPTION to get the description (if available) |
java.lang.String |
getDocumentType()
Returns the document type of the search result document. |
java.lang.String |
getExcerpt()
Returns the excerpt. |
java.lang.String |
getField(java.lang.String fieldName)
Returns the text stored in the search index field with the given name. |
java.lang.String |
getKeywords()
Deprecated. use getField(String) instead with the name of the field,
for example use CmsSearchField.FIELD_KEYWORDS to get the keywords (if available) |
int |
getMemorySize()
Returns the memory size of the object. |
java.lang.String |
getPath()
Returns the path. |
int |
getScore()
Returns the score. |
java.lang.String |
getTitle()
Deprecated. use getField(String) instead with the name of the field,
for example use CmsSearchField.FIELD_TITLE to get the title (if available) |
int |
hashCode()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Date m_dateCreated
protected java.util.Date m_dateLastModified
protected java.lang.String m_documentType
protected java.lang.String m_excerpt
protected java.lang.String m_path
protected int m_score
Constructor Detail |
---|
public CmsSearchResult(int score, org.apache.lucene.document.Document doc, java.lang.String excerpt)
score
- the score of this search resultdoc
- the Lucene document to extract fields from such as description, title, key words etc. pp.excerpt
- the excerpt of the search result's contentMethod Detail |
---|
public int compareTo(CmsSearchResult obj)
compareTo
in interface java.lang.Comparable<CmsSearchResult>
Comparable.compareTo(java.lang.Object)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.util.Date getDateCreated()
public java.util.Date getDateLastModified()
public java.lang.String getDescription()
getField(String)
instead with the name of the field,
for example use CmsSearchField.FIELD_DESCRIPTION
to get the description (if available)
public java.lang.String getDocumentType()
Usually this will be a VFS resource type String that can be used in the
resource type manager with CmsResourceManager.getResourceType(String)
.
However, what is stored in the document type field depends only on the indexer used, and therefore it
may also be some String not referring a VFS resource type but some external type or application.
It may also be null
in case it has not been set by a non-standard indexer.
CmsResourceManager.getResourceType(String)
public java.lang.String getExcerpt()
public java.lang.String getField(java.lang.String fieldName)
fieldName
- the name of the field to get the stored text for
public java.lang.String getKeywords()
getField(String)
instead with the name of the field,
for example use CmsSearchField.FIELD_KEYWORDS
to get the keywords (if available)
public int getMemorySize()
I_CmsMemoryMonitorable
getMemorySize
in interface I_CmsMemoryMonitorable
I_CmsMemoryMonitorable.getMemorySize()
public java.lang.String getPath()
public int getScore()
public java.lang.String getTitle()
getField(String)
instead with the name of the field,
for example use CmsSearchField.FIELD_TITLE
to get the title (if available)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |