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
 void addSelection(BrowseSelection sel)
          Adds a browse selection
 void addSortField(org.apache.lucene.search.SortField sortSpec)
          Add a sort spec
 void clearSelections()
           
 void clearSort()
           
 Map<String,BrowseSelection> getAllSelections()
           
 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()
           
 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
 long getTid()
          Get the transaction ID.
 boolean isFetchStoredFields()
           
 boolean isShowExplanation()
           
 void putAllSelections(Map<String,BrowseSelection> map)
           
 void removeSelection(String name)
           
 void setCount(int count)
          Sets the number of hits to return.
 void setFacetHandlerData(String name, FacetHandlerInitializerParam data)
           
 void setFacetHandlerDataMap(Map<String,FacetHandlerInitializerParam> facetHandlerDataMap)
          Sets the map between RuntimeFacetHandler names and their corresponding initialization data.
 void setFacetSpec(String name, FacetSpec facetSpec)
          Sets a facet spec
 void setFacetSpecs(Map<String,FacetSpec> facetSpecMap)
           
 void setFetchStoredFields(boolean fetchStoredFields)
           
 void setFilter(org.apache.lucene.search.Filter filter)
          Set a default filter
 void setGroupBy(String groupBy)
           
 void setOffset(int offset)
          Sets of the offset.
 void setQuery(org.apache.lucene.search.Query query)
          Set the search query
 void setShowExplanation(boolean showExplanation)
           
 void setSort(org.apache.lucene.search.SortField[] sorts)
          Sets the sort criteria
 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 -

isShowExplanation

public boolean isShowExplanation()

setShowExplanation

public void setShowExplanation(boolean showExplanation)

getSelectionNames

public Set<String> getSelectionNames()

removeSelection

public void removeSelection(String name)

setFacetSpecs

public void 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 void setFacetHandlerDataMap(Map<String,FacetHandlerInitializerParam> facetHandlerDataMap)
Sets the map between RuntimeFacetHandler names and their corresponding initialization data.

Parameters:
facetHandlerDataMap -

getSelectionCount

public int getSelectionCount()

setFilter

public void 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 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)

getGroupBy

public String getGroupBy()

setGroupBy

public void setGroupBy(String groupBy)

setFacetSpec

public void 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 void 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 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(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 void 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 void putAllSelections(Map<String,BrowseSelection> map)

addSortField

public void 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 void 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 © 2011. All Rights Reserved.