com.xpn.xwiki.plugin.lucene
Class ObjectData
java.lang.Object
com.xpn.xwiki.plugin.lucene.IndexData
com.xpn.xwiki.plugin.lucene.ObjectData
public class ObjectData
- extends IndexData
Hold the property values of the XWiki.ArticleClass Objects.
|
Constructor Summary |
ObjectData(com.xpn.xwiki.doc.XWikiDocument doc,
com.xpn.xwiki.XWikiContext context)
|
|
Method Summary |
void |
addDataToLuceneDocument(org.apache.lucene.document.Document luceneDoc,
com.xpn.xwiki.doc.XWikiDocument doc,
com.xpn.xwiki.XWikiContext context)
Adds this documents data to a lucene Document instance for indexing. |
java.lang.String |
getFullText(com.xpn.xwiki.doc.XWikiDocument doc,
com.xpn.xwiki.objects.BaseObject baseObject,
java.lang.String property,
com.xpn.xwiki.XWikiContext context)
|
java.lang.String |
getFullText(com.xpn.xwiki.doc.XWikiDocument doc,
com.xpn.xwiki.XWikiContext context)
|
java.lang.String |
getId()
|
java.lang.String |
getType()
|
| Methods inherited from class com.xpn.xwiki.plugin.lucene.IndexData |
buildQuery, getCreationDate, getCreator, getDocumentFullName, getDocumentName, getDocumentTitle, getDocumentWeb, getFullName, getLanguage, getWiki, setAuthor, setCreationDate, setCreator, setDocumentFullName, setDocumentName, setDocumentTitle, setDocumentWeb, setFullName, setLanguage, setModificationDate, setWiki, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ObjectData
public ObjectData(com.xpn.xwiki.doc.XWikiDocument doc,
com.xpn.xwiki.XWikiContext context)
getType
public java.lang.String getType()
- Specified by:
getType in class IndexData
- See Also:
IndexData.getType()
getId
public java.lang.String getId()
- Overrides:
getId in class IndexData
- Returns:
- string unique to this document across all languages and virtual wikis
getFullText
public java.lang.String getFullText(com.xpn.xwiki.doc.XWikiDocument doc,
com.xpn.xwiki.XWikiContext context)
- Overrides:
getFullText in class IndexData
- Returns:
- a string containing the result of
IndexData.getFullText(XWikiDocument,XWikiContext)plus the full
text content (values of title,category,content and extract ) XWiki.ArticleClass Object, as far as it
could be extracted.
addDataToLuceneDocument
public void addDataToLuceneDocument(org.apache.lucene.document.Document luceneDoc,
com.xpn.xwiki.doc.XWikiDocument doc,
com.xpn.xwiki.XWikiContext context)
- Description copied from class:
IndexData
- 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:
- Keyword fields don't get tokenized, but are
searchable and stored in the index. This is perfect for fields you want to search in programmatically (like ids
and such), and date fields. Since all user-entered queries are tokenized, letting the user search these fields
makes almost no sense, except of queries for date fields, where tokenization is useless.
- the stored text
fields are used for short texts which should be searchable by the user, and stored in the index for
reconstruction. Perfect for document names, titles, abstracts.
- the unstored field takes the biggest part
of the content - the full text. It is tokenized and indexed, but not stored in the index. This makes sense, since
when the user wants to see the full content, he clicks the link to vie the full version of a document, which is
then delivered by xwiki.
- Overrides:
addDataToLuceneDocument in class IndexData
- 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.
getFullText
public java.lang.String getFullText(com.xpn.xwiki.doc.XWikiDocument doc,
com.xpn.xwiki.objects.BaseObject baseObject,
java.lang.String property,
com.xpn.xwiki.XWikiContext context)
Copyright © 2004-2009 XWiki. All Rights Reserved.