public class LuceneSearchResult extends AbstractSearchResult
HIGHLIGHT_END, HIGHLIGHT_START
Constructor and Description |
---|
LuceneSearchResult(org.apache.lucene.document.Document document)
Deprecated.
|
LuceneSearchResult(org.apache.lucene.document.Document document,
com.google.common.base.Function<String,ConfluenceUser> userLookup)
Deprecated.
|
LuceneSearchResult(org.apache.lucene.document.Document document,
Optional<HitHighlighter> maybeHighlighter,
com.google.common.base.Function<String,ConfluenceUser> userLookup)
Constructor to create a search result directly from a Lucene document
|
Modifier and Type | Method and Description |
---|---|
String |
getDisplayTitleWithHighlights()
Gets the title of the search result appropriate for displaying to a user with matches highlighted.
|
String |
getFieldValue(String fieldName)
Return a string value of a field of a given document, if the field has multiple values then return last value,
if there is no such field then return null.
|
Set<String> |
getFieldValues(String fieldName)
Return set of string values of a field of a given document, if the field has single value then return
singleton set of that value, if there is no such field then return empty set.
|
String |
getResultExcerptWithHighlights()
Gets excerpt from the context of the search result, as
SearchResult.getResultExcerpt() , but in a HTML-safe manner. |
boolean |
isFieldRequested(String fieldName)
Deprecated.
|
getContent, getContentVersion, getCreationDate, getCreator, getCreatorUser, getDateResult, getDisplayTitle, getExtraFields, getField, getHandle, getIntegerResult, getLabels, getLastModificationDate, getLastModifier, getLastModifierUser, getLastUpdateDescription, getOwnerTitle, getOwnerType, getPersonalLabels, getResultExcerpt, getResultExcerpt, getSanitisedContent, getSpaceKey, getSpaceName, getStatus, getStringResult, getType, getUrlPath, getUserResult, hasLabels, isHomePage, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getExplain
public LuceneSearchResult(org.apache.lucene.document.Document document, Optional<HitHighlighter> maybeHighlighter, com.google.common.base.Function<String,ConfluenceUser> userLookup)
public LuceneSearchResult(org.apache.lucene.document.Document document, com.google.common.base.Function<String,ConfluenceUser> userLookup)
LuceneSearchResult(org.apache.lucene.document.Document, java.util.Optional, com.google.common.base.Function)
@Deprecated public LuceneSearchResult(org.apache.lucene.document.Document document)
LuceneSearchResult(org.apache.lucene.document.Document, com.google.common.base.Function)
public String getResultExcerptWithHighlights()
SearchResult
SearchResult.getResultExcerpt()
, but in a HTML-safe manner.
Implementations should highlight hits with SearchResult.HIGHLIGHT_START
and SearchResult.HIGHLIGHT_END
.
The default implementation simply HTML-encode the result of SearchResult.getResultExcerpt()
.public String getDisplayTitleWithHighlights()
SearchResult
@Deprecated public boolean isFieldRequested(String fieldName)
public String getFieldValue(String fieldName)
AbstractSearchResult
getFieldValue
in class AbstractSearchResult
public Set<String> getFieldValues(String fieldName)
AbstractSearchResult
getFieldValues
in interface BaseSearchResult
getFieldValues
in class AbstractSearchResult
Copyright © 2003–2018 Atlassian. All rights reserved.