public class SearchHit extends Object implements Serializable
SearchHit
constains information about a "hit" (or row), resulting
from a search of some kind.
The hit will allways contain at least an object id.
If the ids of the objects searched for are numeric, you may obtain the id
by invoking getObjectId()
.
The object id may also be obtained by invoking
getField(DOC_ID)
.
The object returned will be of type java.lang.String
.
Other fields of the objects may be obtained, either by invoking
getField(String)
, or by loading theModifier and Type | Field and Description |
---|---|
static String |
DOC_ID
Constant field name to get the document's (object) id.
|
Constructor and Description |
---|
SearchHit()
Creates a
SearchHit . |
SearchHit(Map<String,Object> pHitFields)
Creates a
SearchHit . |
Modifier and Type | Method and Description |
---|---|
Object |
getField(String pFieldName)
Gets the value of a field from this
SearchHit . |
int |
getObjectId()
Deprecated.
As of Escenic 5.0, an integer based id can no longer uniquely identify an object.
Use
getField(DOC_ID) instead. |
Set<String> |
listFields()
Returns a set of field names present in this
SearchHit . |
String |
toString() |
public static final String DOC_ID
getField(String)
The object returned will be of type java.lang.String
.public SearchHit()
SearchHit
.
NOTE: This constructor is for use by the search API.
Client code should not create SearchHit
s.public int getObjectId()
getField(DOC_ID)
instead.-1
.
This implementation simply returns
Integer.parseInt((String) getField(DOC_ID))
.
Subclasses should provide a more efficient implementation, if possible.-1
, if the object does not have a numeric id.public Object getField(String pFieldName)
SearchHit
.pFieldName
- the name of the field to get a value fromnull
if the field
does not existgetObjectId()
public Set<String> listFields()
SearchHit
.
The elements in the set are of type java.lang.String
.© 1998- 2018 Stibo DX