com.senseidb.search.req
Class SenseiRequest

java.lang.Object
  extended by com.senseidb.search.req.SenseiRequest
All Implemented Interfaces:
AbstractSenseiRequest, Serializable, Cloneable

public class SenseiRequest
extends Object
implements AbstractSenseiRequest, Cloneable

See Also:
Serialized Form

Field Summary
static org.apache.lucene.search.SortField FIELD_DOC
          Represents sorting by document number (index order).
static org.apache.lucene.search.SortField FIELD_DOC_REVERSE
           
static org.apache.lucene.search.SortField FIELD_SCORE
          Represents sorting by document score (relevancy).
static org.apache.lucene.search.SortField FIELD_SCORE_REVERSE
           
 
Constructor Summary
SenseiRequest()
           
 
Method Summary
 void addSelection(com.browseengine.bobo.api.BrowseSelection sel)
          Adds a browse selection
 void addSelections(com.browseengine.bobo.api.BrowseSelection[] selections)
          Adds a browse selection array
 void addSortField(org.apache.lucene.search.SortField sortSpec)
          Add a sort spec
 void addSortFields(org.apache.lucene.search.SortField[] sortSpecs)
          Add a sort spec
 void clearSelections()
           
 void clearSort()
           
 Object clone()
           
 boolean equals(Object o)
           
static SenseiRequest fromJSON(org.json.JSONObject json)
           
 int getCount()
          Gets the number of hits to return.
 com.browseengine.bobo.facets.FacetHandlerInitializerParam getFacetHandlerInitializerParam(String name)
           
 Map<String,com.browseengine.bobo.facets.FacetHandlerInitializerParam> getFacetHandlerInitParamMap()
           
 com.browseengine.bobo.api.FacetSpec getFacetSpec(String name)
          Gets a facet spec
 int getFacetSpecCount()
          Gets the number of facet specs
 Map<String,com.browseengine.bobo.api.FacetSpec> getFacetSpecs()
           
 String getGroupBy()
           
 int getMaxPerGroup()
           
 int getOffset()
          Gets the offset.
 Set<Integer> getPartitions()
           
 SenseiQuery getQuery()
          Gets the search query
 String getRouteParam()
           
 com.browseengine.bobo.api.BrowseSelection getSelection(String fieldname)
          Gets selection by field name
 int getSelectionCount()
           
 Set<String> getSelectionNames()
           
 com.browseengine.bobo.api.BrowseSelection[] getSelections()
          Gets all added browse selections
 List<String> getSelectList()
          Gets the select list.
 org.apache.lucene.search.SortField[] getSort()
          Gets the sort criteria
 Set<String> getTermVectorsToFetch()
           
 long getTid()
          Get the transaction ID.
 boolean isFetchStoredFields()
           
 boolean isFetchStoredValue()
           
 boolean isShowExplanation()
           
 void putAllFacetHandlerInitializerParams(Map<String,com.browseengine.bobo.facets.FacetHandlerInitializerParam> params)
           
 void removeSelection(String name)
           
 void restoreState()
           
 void saveState()
           
 void setCount(int count)
          Sets the number of hits to return.
 void setFacetHandlerInitializerParam(String name, com.browseengine.bobo.facets.FacetHandlerInitializerParam param)
           
 void setFacetHandlerInitParamMap(Map<String,com.browseengine.bobo.facets.FacetHandlerInitializerParam> paramMap)
           
 void setFacetSpec(String name, com.browseengine.bobo.api.FacetSpec facetSpec)
          Sets a facet spec
 void setFacetSpecs(Map<String,com.browseengine.bobo.api.FacetSpec> facetSpecMap)
           
 void setFetchStoredFields(boolean fetchStoredFields)
           
 void setFetchStoredValue(boolean fetchStoredValue)
           
 void setGroupBy(String groupBy)
           
 void setMaxPerGroup(int maxPerGroup)
           
 void setOffset(int offset)
          Sets of the offset.
 void setPartitions(Set<Integer> partitions)
           
 void setQuery(SenseiQuery query)
          Set the search query
 void setRouteParam(String routeParam)
           
 void setSelectList(List<String> selectList)
          Sets the select list.
 void setShowExplanation(boolean showExplanation)
           
 void setSort(org.apache.lucene.search.SortField[] sorts)
          Sets the sort criteria
 void setTermVectorsToFetch(Set<String> termVectorsToFetch)
           
 void setTid(long tid)
          Set the transaction ID;
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIELD_SCORE

public static final org.apache.lucene.search.SortField FIELD_SCORE
Represents sorting by document score (relevancy).


FIELD_SCORE_REVERSE

public static final org.apache.lucene.search.SortField FIELD_SCORE_REVERSE

FIELD_DOC

public static final org.apache.lucene.search.SortField FIELD_DOC
Represents sorting by document number (index order).


FIELD_DOC_REVERSE

public static final org.apache.lucene.search.SortField FIELD_DOC_REVERSE
Constructor Detail

SenseiRequest

public SenseiRequest()
Method Detail

getTermVectorsToFetch

public Set<String> getTermVectorsToFetch()

setTermVectorsToFetch

public void setTermVectorsToFetch(Set<String> termVectorsToFetch)

getTid

public final long getTid()
Get the transaction ID.

Returns:
the transaction ID.

setTid

public final void setTid(long tid)
Set the transaction ID;

Parameters:
tid -

isShowExplanation

public boolean isShowExplanation()

setShowExplanation

public void setShowExplanation(boolean showExplanation)

setPartitions

public void setPartitions(Set<Integer> partitions)
Specified by:
setPartitions in interface AbstractSenseiRequest

getPartitions

public Set<Integer> getPartitions()
Specified by:
getPartitions in interface AbstractSenseiRequest

setRouteParam

public void setRouteParam(String routeParam)

getRouteParam

public String getRouteParam()
Specified by:
getRouteParam in interface AbstractSenseiRequest

setGroupBy

public void setGroupBy(String groupBy)

getGroupBy

public String getGroupBy()

setMaxPerGroup

public void setMaxPerGroup(int maxPerGroup)

getMaxPerGroup

public int getMaxPerGroup()

getFacetHandlerInitParamMap

public Map<String,com.browseengine.bobo.facets.FacetHandlerInitializerParam> getFacetHandlerInitParamMap()

setFacetHandlerInitParamMap

public void setFacetHandlerInitParamMap(Map<String,com.browseengine.bobo.facets.FacetHandlerInitializerParam> paramMap)

putAllFacetHandlerInitializerParams

public void putAllFacetHandlerInitializerParams(Map<String,com.browseengine.bobo.facets.FacetHandlerInitializerParam> params)

setFacetHandlerInitializerParam

public void setFacetHandlerInitializerParam(String name,
                                            com.browseengine.bobo.facets.FacetHandlerInitializerParam param)

getFacetHandlerInitializerParam

public com.browseengine.bobo.facets.FacetHandlerInitializerParam getFacetHandlerInitializerParam(String name)

getSelectionNames

public Set<String> getSelectionNames()

removeSelection

public void removeSelection(String name)

setFacetSpecs

public void setFacetSpecs(Map<String,com.browseengine.bobo.api.FacetSpec> facetSpecMap)

getFacetSpecs

public Map<String,com.browseengine.bobo.api.FacetSpec> getFacetSpecs()

saveState

public void saveState()
Specified by:
saveState in interface AbstractSenseiRequest

restoreState

public void restoreState()
Specified by:
restoreState in interface AbstractSenseiRequest

getSelectionCount

public int getSelectionCount()

clearSelections

public void clearSelections()

getFacetSpecCount

public int getFacetSpecCount()
Gets the number of facet specs

Returns:
number of facet pecs
See Also:
setFacetSpec(String, FacetSpec), getFacetSpec(String)

clearSort

public void clearSort()

isFetchStoredFields

public boolean isFetchStoredFields()

setFetchStoredFields

public void setFetchStoredFields(boolean fetchStoredFields)

isFetchStoredValue

public boolean isFetchStoredValue()

setFetchStoredValue

public void setFetchStoredValue(boolean fetchStoredValue)

setFacetSpec

public void setFacetSpec(String name,
                         com.browseengine.bobo.api.FacetSpec facetSpec)
Sets a facet spec

Parameters:
name - field name
facetSpec - Facet spec
See Also:
getFacetSpec(String)

getFacetSpec

public com.browseengine.bobo.api.FacetSpec getFacetSpec(String name)
Gets a facet spec

Parameters:
name - field name
Returns:
facet spec
See Also:
setFacetSpec(String, FacetSpec)

getCount

public int getCount()
Gets the number of hits to return. Part of the paging parameters.

Returns:
number of hits to return.
See Also:
setCount(int)

setCount

public void setCount(int count)
Sets the number of hits to return. Part of the paging parameters.

Parameters:
count - number of hits to return.
See Also:
getCount()

getOffset

public int getOffset()
Gets the offset. Part of the paging parameters.

Returns:
offset
See Also:
setOffset(int)

setOffset

public void setOffset(int offset)
Sets of the offset. Part of the paging parameters.

Parameters:
offset - offset
See Also:
getOffset()

setQuery

public void setQuery(SenseiQuery query)
Set the search query

Parameters:
query - query object
See Also:
getQuery()

getQuery

public SenseiQuery getQuery()
Gets the search query

Returns:
query object
See Also:
setQuery(SenseiQuery)

addSelections

public void addSelections(com.browseengine.bobo.api.BrowseSelection[] selections)
Adds a browse selection array

Parameters:
selections - selections to add
See Also:
addSelection(BrowseSelection), getSelections()

addSelection

public void addSelection(com.browseengine.bobo.api.BrowseSelection sel)
Adds a browse selection

Parameters:
sel - selection
See Also:
getSelections()

getSelections

public com.browseengine.bobo.api.BrowseSelection[] getSelections()
Gets all added browse selections

Returns:
added selections
See Also:
addSelection(BrowseSelection)

getSelection

public com.browseengine.bobo.api.BrowseSelection getSelection(String fieldname)
Gets selection by field name

Parameters:
fieldname -
Returns:
selection on the field

addSortField

public void addSortField(org.apache.lucene.search.SortField sortSpec)
Add a sort spec

Parameters:
sortSpec - sort spec
See Also:
getSort(), setSort(SortField[])

addSortFields

public void addSortFields(org.apache.lucene.search.SortField[] sortSpecs)
Add a sort spec

Parameters:
sortSpecs - sort spec
See Also:
getSort(), setSort(SortField[])

getSort

public org.apache.lucene.search.SortField[] getSort()
Gets the sort criteria

Returns:
sort criteria
See Also:
setSort(SortField[]), addSortField(SortField)

setSort

public void setSort(org.apache.lucene.search.SortField[] sorts)
Sets the sort criteria

Parameters:
sorts - sort criteria
See Also:
addSortField(SortField), getSort()

setSelectList

public void setSelectList(List<String> selectList)
Sets the select list.

Parameters:
selectList - select list

getSelectList

public List<String> getSelectList()
Gets the select list.

Returns:
select list.

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

fromJSON

public static SenseiRequest fromJSON(org.json.JSONObject json)
                              throws Exception
Throws:
Exception


Copyright © 2010-2012. All Rights Reserved.