com.xpn.xwiki.plugin.lucene
Class SearchResult

java.lang.Object
  extended by com.xpn.xwiki.plugin.lucene.SearchResult

public class SearchResult
extends java.lang.Object

Result of a search. The Plugin will return a collection of these for display on the search page.

Version:
$Id: SearchResult.java 24078 2009-09-27 02:37:41Z sdumitriu $

Constructor Summary
SearchResult(org.apache.lucene.document.Document doc, float score, com.xpn.xwiki.api.XWiki xwiki)
           
 
Method Summary
 java.lang.String getAuthor()
           
 java.util.Date getCreationDate()
           
 java.lang.String getCreator()
           
 java.util.Date getDate()
           
 java.lang.String getFilename()
           
 java.lang.String getFullName()
           
 java.lang.String getId()
           
 java.lang.String getLanguage()
           
 java.lang.String getName()
           
 java.lang.String[] getObjects()
           
 float getScore()
           
 java.lang.String getSpace()
           
 java.lang.String getTitle()
           
 java.lang.String getType()
           
 java.lang.String getUrl()
           
 java.lang.String getWeb()
          Deprecated. Use getSpace() instead.
 java.lang.String getWiki()
           
 boolean isWikiContent()
           
 void setUrl(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchResult

public SearchResult(org.apache.lucene.document.Document doc,
                    float score,
                    com.xpn.xwiki.api.XWiki xwiki)
Method Detail

getId

public java.lang.String getId()
Returns:
the document id as indexed

getAuthor

public java.lang.String getAuthor()
Returns:
Returns the name of the user who last modified the document.

getDate

public java.util.Date getDate()
Returns:
Returns the date of last modification.

getFilename

public java.lang.String getFilename()
Returns:
Returns the filename, only used for Attachments (see getType())

getTitle

public java.lang.String getTitle()
Returns:
the title of the document.

getName

public java.lang.String getName()
Returns:
Returns the name of the document.

getScore

public float getScore()
Returns:
Returns the score of this search result as computed by lucene. Is a float between zero and 1.

getType

public java.lang.String getType()
Returns:
Returns the type of the document, atm this can be either wikipage or attachment.

getUrl

public java.lang.String getUrl()
Returns:
Returns the url to access the document.

getWeb

@Deprecated
public java.lang.String getWeb()
Deprecated. Use getSpace() instead.

Returns:
Returns the space the document belongs to.

getSpace

public java.lang.String getSpace()
Returns:
Returns the space the document belongs to.

getLanguage

public java.lang.String getLanguage()
Returns:
the language of the Document, i.e. de or en,default if no language was set at indexing time.

getCreationDate

public java.util.Date getCreationDate()
Returns:
creationDate of this document

getCreator

public java.lang.String getCreator()
Returns:
Username of the creator of the document

setUrl

public void setUrl(java.lang.String url)

getWiki

public java.lang.String getWiki()

getFullName

public java.lang.String getFullName()

getObjects

public java.lang.String[] getObjects()

isWikiContent

public boolean isWikiContent()
Returns:
true when this result points to wiki content (attachment, wiki page or object)


Copyright © 2004-2009 XWiki. All Rights Reserved.