public class SearchResultItem
extends java.lang.Object
SearchResult
list.
The SearchResultItem is a search item related to the indexed ObjectContent object.Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<ContentItem> |
content
An object's text content represented as a list of
ContentItem objects. |
int |
dw
The length of a best relevant piece of text content
(a quantity of content list elements)
|
int |
idf
An object id in the search index
|
int |
n
A sequential number of a search result item
|
java.util.ArrayList<ObjectItem> |
objects
A list of
ObjectItem objects having the same text content which are linked
with this search result item. |
int |
p1
An index of the beginning of the best relevant content piece (0-based)
|
ScanResult |
scanR
A searching parameters of this item
|
Constructor and Description |
---|
SearchResultItem() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentRelevantPiece(int dp,
int nwords,
java.lang.String formatSword)
Get a best relevant content piece.
|
public int n
public int idf
public int p1
public int dw
public java.util.ArrayList<ContentItem> content
ContentItem
objects.public java.util.ArrayList<ObjectItem> objects
ObjectItem
objects having the same text content which are linked
with this search result item.public ScanResult scanR
public java.lang.String getContentRelevantPiece(int dp, int nwords, java.lang.String formatSword)
An example of usage:
getContentRelevantPiece(10, 20, "<b>%s</b>");
This call returns a string with a piece of 20 words from the 10-th position behind the beginning of a best relevant phrase. Each word contained in a search phrase will be marked in result as a bold text.
dp
- A position offset behind the beginning of the best relevant piece of object content.nwords
- A length in words of the returning content piece.formatSword
- A format string for formatting a content word which is in a search phrase via String.format method.nwords
length from position p1
- dp.String.format(java.lang.String, java.lang.Object...)