com.xpn.xwiki.plugin.lucene
Class AbstractIndexData

java.lang.Object
  extended by com.xpn.xwiki.plugin.lucene.AbstractIndexData
Direct Known Subclasses:
AbstractDocumentData, WikiData

public abstract class AbstractIndexData
extends java.lang.Object

Since:
1.23
Version:
$Id$

Constructor Summary
AbstractIndexData(java.lang.String type, EntityReference entityReference, boolean deleted)
           
 
Method Summary
 void addDataToLuceneDocument(org.apache.lucene.document.Document luceneDoc, XWikiContext context)
          Adds this documents data to a lucene Document instance for indexing.
 java.lang.String getDocumentFullName()
           
 java.lang.String getDocumentName()
           
 java.lang.String getDocumentSpace()
           
protected  java.lang.String getEntityName(EntityType type)
           
 EntityReference getEntityReference()
           
 java.lang.String getFullName()
           
protected abstract  void getFullText(java.lang.StringBuilder sb, com.xpn.xwiki.doc.XWikiDocument doc, XWikiContext context)
           
 java.lang.String getFullText(com.xpn.xwiki.doc.XWikiDocument doc, XWikiContext context)
           
abstract  java.lang.String getId()
           
 org.apache.lucene.index.Term getTerm()
           
 java.lang.String getType()
           
 java.lang.String getWiki()
           
 boolean isDeleted()
           
 void setDeleted(boolean deleted)
           
 void setEntityReference(EntityReference entityReference)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractIndexData

public AbstractIndexData(java.lang.String type,
                         EntityReference entityReference,
                         boolean deleted)
Method Detail

addDataToLuceneDocument

public void addDataToLuceneDocument(org.apache.lucene.document.Document luceneDoc,
                                    XWikiContext context)
                             throws XWikiException
Adds this documents data to a lucene Document instance for indexing.

Short introduction to Lucene field types

Which type of Lucene field is used determines what Lucene does with data and how we can use it for searching and showing search results:

Parameters:
luceneDoc - if not null, this controls which translated version of the content will be indexed. If null, the content in the default language will be used.
Throws:
XWikiException

getId

public abstract java.lang.String getId()
Returns:
string unique to this document across all languages and virtual wikis

getTerm

public org.apache.lucene.index.Term getTerm()

getFullText

public java.lang.String getFullText(com.xpn.xwiki.doc.XWikiDocument doc,
                                    XWikiContext context)
Returns:
String of documentName, documentWeb, author and creator

getFullText

protected abstract void getFullText(java.lang.StringBuilder sb,
                                    com.xpn.xwiki.doc.XWikiDocument doc,
                                    XWikiContext context)

getType

public java.lang.String getType()

setDeleted

public void setDeleted(boolean deleted)
See Also:
isDeleted()

isDeleted

public boolean isDeleted()
Returns:
indicate of the element should be deleted from he index

getEntityReference

public EntityReference getEntityReference()

setEntityReference

public void setEntityReference(EntityReference entityReference)

getEntityName

protected java.lang.String getEntityName(EntityType type)

getDocumentName

public java.lang.String getDocumentName()

getDocumentSpace

public java.lang.String getDocumentSpace()

getWiki

public java.lang.String getWiki()

getDocumentFullName

public java.lang.String getDocumentFullName()

getFullName

public java.lang.String getFullName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004-2011 XWiki. All Rights Reserved.