com.browseengine.bobo.api
Class BrowseRequest

java.lang.Object
  extended by com.browseengine.bobo.api.BrowseRequest
All Implemented Interfaces:
Serializable

public class BrowseRequest
extends Object
implements Serializable

Browse Request.

Since:
1.0
Version:
1.0
Author:
jwang
See Also:
Serialized Form

Constructor Summary
BrowseRequest()
          Constructor.
 
Method Summary
 BrowseRequest addSelection(BrowseSelection sel)
          Adds a browse selection
 BrowseRequest addSortField(org.apache.lucene.search.SortField sortSpec)
          Add a sort spec
 BrowseRequest clearSelections()
           
 BrowseRequest clearSort()
           
 Map<String,BrowseSelection> getAllSelections()
           
 boolean getCollectDocIdCache()
           
 int getCount()
          Gets the number of hits to return.
 FacetHandlerInitializerParam getFacethandlerData(String name)
           
 Map<String,FacetHandlerInitializerParam> getFacetHandlerDataMap()
           
 FacetSpec getFacetSpec(String name)
          Gets a facet spec
 int getFacetSpecCount()
          Gets the number of facet specs
 Map<String,FacetSpec> getFacetSpecs()
           
 org.apache.lucene.search.Filter getFilter()
          Gets the default filter
 String[] getGroupBy()
           
 BoboMapFunctionWrapper getMapReduceWrapper()
           
 int getMaxPerGroup()
           
 int getOffset()
          Gets the offset.
 org.apache.lucene.search.Query getQuery()
          Gets the search query
 BrowseSelection getSelection(String fieldname)
          Gets selection by field name
 int getSelectionCount()
           
 Set<String> getSelectionNames()
           
 BrowseSelection[] getSelections()
          Gets all added browse selections
 org.apache.lucene.search.SortField[] getSort()
          Gets the sort criteria
 Set<String> getTermVectorsToFetch()
           
 long getTid()
          Get the transaction ID.
 boolean isFetchStoredFields()
           
 boolean isShowExplanation()
           
 BrowseRequest putAllSelections(Map<String,BrowseSelection> map)
           
 void removeSelection(String name)
           
 BrowseRequest setCollectDocIdCache(boolean collectDocIdCache)
           
 BrowseRequest setCount(int count)
          Sets the number of hits to return.
 BrowseRequest setFacetHandlerData(String name, FacetHandlerInitializerParam data)
           
 BrowseRequest setFacetHandlerDataMap(Map<String,FacetHandlerInitializerParam> facetHandlerDataMap)
          Sets the map between RuntimeFacetHandler names and their corresponding initialization data.
 BrowseRequest setFacetSpec(String name, FacetSpec facetSpec)
          Sets a facet spec
 BrowseRequest setFacetSpecs(Map<String,FacetSpec> facetSpecMap)
           
 BrowseRequest setFetchStoredFields(boolean fetchStoredFields)
           
 BrowseRequest setFilter(org.apache.lucene.search.Filter filter)
          Set a default filter
 BrowseRequest setGroupBy(String[] groupBy)
           
 BrowseRequest setMapReduceWrapper(BoboMapFunctionWrapper mapReduceWrapper)
           
 BrowseRequest setMaxPerGroup(int maxPerGroup)
           
 BrowseRequest setOffset(int offset)
          Sets of the offset.
 BrowseRequest setQuery(org.apache.lucene.search.Query query)
          Set the search query
 BrowseRequest setShowExplanation(boolean showExplanation)
           
 BrowseRequest 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BrowseRequest

public BrowseRequest()
Constructor.

Method Detail

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 -

getTermVectorsToFetch

public Set<String> getTermVectorsToFetch()

setTermVectorsToFetch

public void setTermVectorsToFetch(Set<String> termVectorsToFetch)

isShowExplanation

public boolean isShowExplanation()

setShowExplanation

public BrowseRequest setShowExplanation(boolean showExplanation)

getSelectionNames

public Set<String> getSelectionNames()

removeSelection

public void removeSelection(String name)

setFacetSpecs

public BrowseRequest setFacetSpecs(Map<String,FacetSpec> facetSpecMap)

getFacetSpecs

public Map<String,FacetSpec> getFacetSpecs()

getFacetHandlerDataMap

public Map<String,FacetHandlerInitializerParam> getFacetHandlerDataMap()
Returns:
The map between RuntimeFacetHandler names and their corresponding initialization data.

setFacetHandlerDataMap

public BrowseRequest setFacetHandlerDataMap(Map<String,FacetHandlerInitializerParam> facetHandlerDataMap)
Sets the map between RuntimeFacetHandler names and their corresponding initialization data.

Parameters:
facetHandlerDataMap -

getSelectionCount

public int getSelectionCount()

setFilter

public BrowseRequest setFilter(org.apache.lucene.search.Filter filter)
Set a default filter

Parameters:
filter -

getFilter

public org.apache.lucene.search.Filter getFilter()
Gets the default filter


clearSelections

public BrowseRequest 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 BrowseRequest clearSort()

isFetchStoredFields

public boolean isFetchStoredFields()

setFetchStoredFields

public BrowseRequest setFetchStoredFields(boolean fetchStoredFields)

getGroupBy

public String[] getGroupBy()

setGroupBy

public BrowseRequest setGroupBy(String[] groupBy)

getMaxPerGroup

public int getMaxPerGroup()

setMaxPerGroup

public BrowseRequest setMaxPerGroup(int maxPerGroup)

getCollectDocIdCache

public boolean getCollectDocIdCache()

setCollectDocIdCache

public BrowseRequest setCollectDocIdCache(boolean collectDocIdCache)

setFacetSpec

public BrowseRequest setFacetSpec(String name,
                                  FacetSpec facetSpec)
Sets a facet spec

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

getFacetSpec

public FacetSpec getFacetSpec(String name)
Gets a facet spec

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

setFacetHandlerData

public BrowseRequest setFacetHandlerData(String name,
                                         FacetHandlerInitializerParam data)
Parameters:
name - is the name of the RuntimeFacetHandler.
data - is the data Bobo is to use to initialize the corresponding RuntimeFacetHandler.

getFacethandlerData

public FacetHandlerInitializerParam getFacethandlerData(String name)
Parameters:
name - is the name of the RuntimeFacetHandler.
Returns:
the data Bobo is to use to initialize the corresponding RuntimeFacetHandler.

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 BrowseRequest 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 BrowseRequest setOffset(int offset)
Sets of the offset. Part of the paging parameters.

Parameters:
offset - offset
See Also:
getOffset()

setQuery

public BrowseRequest setQuery(org.apache.lucene.search.Query query)
Set the search query

Parameters:
query - lucene search query
See Also:
getQuery()

getQuery

public org.apache.lucene.search.Query getQuery()
Gets the search query

Returns:
lucene search query
See Also:
setQuery(Query)

addSelection

public BrowseRequest addSelection(BrowseSelection sel)
Adds a browse selection

Parameters:
sel - selection
See Also:
getSelections()

getSelections

public BrowseSelection[] getSelections()
Gets all added browse selections

Returns:
added selections
See Also:
addSelection(BrowseSelection)

getSelection

public BrowseSelection getSelection(String fieldname)
Gets selection by field name

Parameters:
fieldname -
Returns:
selection on the field

getAllSelections

public Map<String,BrowseSelection> getAllSelections()

putAllSelections

public BrowseRequest putAllSelections(Map<String,BrowseSelection> map)

getMapReduceWrapper

public BoboMapFunctionWrapper getMapReduceWrapper()

setMapReduceWrapper

public BrowseRequest setMapReduceWrapper(BoboMapFunctionWrapper mapReduceWrapper)

addSortField

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

Parameters:
sortSpec - 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 BrowseRequest setSort(org.apache.lucene.search.SortField[] sorts)
Sets the sort criteria

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2013. All Rights Reserved.