de.pangaea.metadataportal.search
Class SearchResultItem

java.lang.Object
  extended by de.pangaea.metadataportal.search.SearchResultItem

public class SearchResultItem
extends Object

This class holds one search result item.

Author:
Uwe Schindler

Field Summary
protected  Config config
           
 
Constructor Summary
protected SearchResultItem(Config config, float score, org.apache.lucene.document.Document doc)
          Internal use only!
 
Method Summary
 Object[] getField(String fieldName)
          Returns the values of the supplied field name.
 Map<String,Object[]> getFields()
          Returns a mapping of all field names to values.
 String getIdentifier()
          Returns the identifier of the search result in the index.
 float getScore()
          Gets score of item (0.0<score<=1.0).
 String getXml()
          Returns the XML source code as String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected Config config
Constructor Detail

SearchResultItem

protected SearchResultItem(Config config,
                           float score,
                           org.apache.lucene.document.Document doc)
Internal use only!

Method Detail

getScore

public float getScore()
Gets score of item (0.0<score<=1.0).


getXml

public String getXml()
Returns the XML source code as String. Can be fed into a XML parser via StringReader.


getIdentifier

public String getIdentifier()
Returns the identifier of the search result in the index.


getField

public Object[] getField(String fieldName)
Returns the values of the supplied field name.

Parameters:
fieldName - name of field
Returns:
an array of String, Double, or Date values depending on the data type (FieldConfig.DataType) in field configuration. Returns null if the document does not contain a value for this field.
Throws:
IllegalFieldConfigException - if fieldName is not a stored field

getFields

public Map<String,Object[]> getFields()
Returns a mapping of all field names to values.

Returns:
a Map mapping field names to arrays of String, Double, or Date values depending on the data type (FieldConfig.DataType) in field configuration


Copyright ©2007-2009 panFMP Developers c/o Uwe Schindler