|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PassageBuilder
An interface that will allow applications to build a set of passages to display from a search result.
Result.getPassageBuilder()| Method Summary | |
|---|---|
void |
addPassageField(java.lang.String fieldName)
Registers a field for which we would like to get passages. |
void |
addPassageField(java.lang.String fieldName,
Passage.Type type,
int context,
int maxSize,
boolean doSort)
Registers the parameters for a field for which we would like to get passages. |
java.util.Map<java.lang.String,java.util.List<Passage>> |
getPassages(java.util.Map document)
Gets the highlighted passages that were specified using addPassageField. |
java.util.List<Passage> |
getPassages(java.util.Map document,
int context,
int maxSize)
Gets all of the passages in the document as a list. |
java.util.Map<java.lang.String,java.util.List<Passage>> |
getPassages(java.util.Map document,
int context,
int maxSize,
boolean doSort)
Gets the highlighted passages that were specified using addPassageField. |
| Method Detail |
|---|
void addPassageField(java.lang.String fieldName)
This is mostly a convenience for highlighting all of the passages in a field that is expected to be small (say, like the subject of an email message.)
fieldName - The name of the field that we want to collect
passages for. If this name is null, the other
parameters specify the data for anything that is not in one of the
fields added using addPassageField. If the name is
NonField, then the other parameters specify the data
for passages that do not occur in any field.
void addPassageField(java.lang.String fieldName,
Passage.Type type,
int context,
int maxSize,
boolean doSort)
fieldName - The name of the field that we want to collect
passages for. If this name is null, the other
parameters specify the data for anything that is not in one of the
fields added using addPassageField. If the name is
NonField, then the other parameters specify the data
for passages that do not occur in any field.type - The type of passage to build. If this is
JOIN, then all hits within the named field will
be joined into a single passage. If this is
UNIQUE, then each hit will be a separate
passage.context - The size of the surrounding context to put in the
passage, in words. -1 means take the entire containing field.maxSize - The maximum size of passage to return, in characters.
-1 means any size is OK.doSort - If true, then the passages for this field
will be sorted by score before being returned.java.util.Map<java.lang.String,java.util.List<Passage>> getPassages(java.util.Map document)
addPassageField.
document - A map representing a list of field names and
values.
Map that maps from field names to a
List of instances of Passage that are
associated with the field. The key null maps to
passages that did not occur in any field.SearchEngine.index(java.lang.String, java.util.Map),
addPassageField(java.lang.String)
java.util.Map<java.lang.String,java.util.List<Passage>> getPassages(java.util.Map document,
int context,
int maxSize,
boolean doSort)
addPassageField.
document - A map representing a list of field names and
values.context - the amount of context that will be used around
passages in fields that were not explicitly added.maxSize - the maximum size of passage to return, in characters,
for fields that were not explicitly added. -1 means any size is OK.doSort - If true, passages from any fields not
explictly added will be sorted by score before being returned.
Map that maps from field names to a
List of instances of Passage that are
associated with the field. The key null maps to
passages that did not occur in any field and to passages from fields
that were not explicitly added.SearchEngine.index(java.lang.String, java.util.Map),
addPassageField(java.lang.String)
java.util.List<Passage> getPassages(java.util.Map document,
int context,
int maxSize)
document - A map representing a list of field names and
values.context - The size of the surrounding context to put in the passage,
in words. -1 means take an entire field value as context.maxSize - The maximum size of passage to return, in characters. -1
means any size is OK.
Passages.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||