org.compass.core.support.search
Class CompassSearchCommand

java.lang.Object
  extended by org.compass.core.support.search.CompassSearchCommand

public class CompassSearchCommand
extends Object

The search command object which holds the query that needs to be executed in the search operation. It might hold the page parameter as well if using the pagination feature.

The seach helper can accept either a query string or a CompassQuery. If both are set, the CompassQuery will be used.

Author:
kimchy
See Also:
CompassSearchHelper, CompassSearchResults

Constructor Summary
CompassSearchCommand()
          Constructs a new search commad.
CompassSearchCommand(CompassQuery query)
          Constructs a new search command with the give search query.
CompassSearchCommand(CompassQuery query, Integer page)
          Constructs a new search command with the given query and the page number (in case CompassSearchHelper is used with pagination.
CompassSearchCommand(String query)
          Constructs a new search command with the give search query.
CompassSearchCommand(String query, Integer page)
          Constructs a new search command with the given query and the page number (in case CompassSearchHelper is used with pagination.
 
Method Summary
 CompassQuery getCompassQuery()
          Returns a compass query.
 Integer getPage()
          Returns the page paramter if using the CompassSearchHelper pagination feature.
 String getQuery()
          Returns the query that will be executed by Compass in the search operation.
 void setPage(Integer page)
          Sets the page paramter if using the CompassSearchHelper pagination feature.
 void setQuery(String query)
          Sets the query that will be executed by Compass in the search operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompassSearchCommand

public CompassSearchCommand()
Constructs a new search commad. At least the search query must be set using setQuery(String).


CompassSearchCommand

public CompassSearchCommand(String query)
Constructs a new search command with the give search query.

Parameters:
query - The search query

CompassSearchCommand

public CompassSearchCommand(String query,
                            Integer page)
Constructs a new search command with the given query and the page number (in case CompassSearchHelper is used with pagination.

Parameters:
query - The search query
page - The page number

CompassSearchCommand

public CompassSearchCommand(CompassQuery query)
Constructs a new search command with the give search query.

Parameters:
query - The search query

CompassSearchCommand

public CompassSearchCommand(CompassQuery query,
                            Integer page)
Constructs a new search command with the given query and the page number (in case CompassSearchHelper is used with pagination.

Parameters:
query - The search query
page - The page number
Method Detail

getQuery

public String getQuery()
Returns the query that will be executed by Compass in the search operation.

Returns:
The query for the search operation

setQuery

public void setQuery(String query)
Sets the query that will be executed by Compass in the search operation.

Parameters:
query - The search query

getCompassQuery

public CompassQuery getCompassQuery()
Returns a compass query.

Returns:
The compass query

getPage

public Integer getPage()
Returns the page paramter if using the CompassSearchHelper pagination feature.

Returns:
The current page number

setPage

public void setPage(Integer page)
Sets the page paramter if using the CompassSearchHelper pagination feature.

Parameters:
page - The page number


Copyright (c) 2004-2009 The Compass Project.