com.googlecode.fascinator.common.solr
Class SolrResult

java.lang.Object
  extended by com.googlecode.fascinator.common.JsonSimple
      extended by com.googlecode.fascinator.common.solr.SolrResult

public class SolrResult
extends JsonSimple

An extension of the JsonSimple class specifically to address Solr result documents and shortcut common access.

Author:
Greg Pendlebury

Constructor Summary
SolrResult(InputStream jsonIn)
          Creates SolrResult object from the provided input stream
SolrResult(String jsonString)
          Creates SolrResult object from the provided string
 
Method Summary
 Map<String,SolrFacet> getFacets()
          Return the List of SolrFacet objects from this result set.
 List<String> getFieldList(String field)
           Search for the indicated field in the results set and return a list of the values.
 Integer getNumFound()
           Return the number of documents found by this result set.
 Integer getQueryTime()
          Return the time taken to perform this search
 List<SolrDoc> getResults()
          Return the list of documents from this results set wrapped in utility objects.
 Integer getRows()
           Return the number of documents returned by this result set.
 Integer getStartRow()
           Return the index of the first row in this result set [getRows()] compared to number found [getNumFound()].
 Integer getStatus()
          Return the status code for the search
 
Methods inherited from class com.googlecode.fascinator.common.JsonSimple
fromJavaMap, getArray, getBoolean, getInteger, getJsonObject, getJsonSimpleList, getJsonSimpleMap, getObject, getPath, getString, getStringList, getStringList, getStringList, search, setPropertySubstitution, toJavaList, toJavaMap, toString, toString, writeArray, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SolrResult

public SolrResult(InputStream jsonIn)
           throws IOException
Creates SolrResult object from the provided input stream

Parameters:
jsonIn - : The input stream to read
Throws:
IOException - if there was an error during creation

SolrResult

public SolrResult(String jsonString)
           throws IOException
Creates SolrResult object from the provided string

Parameters:
jsonString - : The JSON in string form
Throws:
IOException - if there was an error during creation
Method Detail

getFacets

public Map<String,SolrFacet> getFacets()
Return the List of SolrFacet objects from this result set.

Returns:
List : The list of facets

getFieldList

public List<String> getFieldList(String field)

Search for the indicated field in the results set and return a list of the values.

Parameters:
field - : The field to search for
Returns:
List : The List of values found from this field

getNumFound

public Integer getNumFound()

Return the number of documents found by this result set. Note that this is not the same as the number of documents returned [getRows()], which is the current 'page'.

Returns:
Integer : The results total for this search

getQueryTime

public Integer getQueryTime()
Return the time taken to perform this search

Returns:
Integer : The time spent searching

getResults

public List<SolrDoc> getResults()
Return the list of documents from this results set wrapped in utility objects.

Returns:
List : The list of documents returned

getRows

public Integer getRows()

Return the number of documents returned by this result set. Note that this is not the same as the number of documents found [getNumFound()]. This is just the current 'page'.

Returns:
Integer : The results total for this search

getStartRow

public Integer getStartRow()

Return the index of the first row in this result set [getRows()] compared to number found [getNumFound()].

Returns:
Integer : The results total for this search

getStatus

public Integer getStatus()
Return the status code for the search

Returns:
Integer : The status code


Copyright © 2009-2013. All Rights Reserved.