Package com.massifmaps.search
Class SearchRequest
java.lang.Object
com.massifmaps.search.SearchRequest
A search request description. Contains various search filters,
including geometry proximity test, regular expression test for all attributes
and a custom SQL-like search filter.
including geometry proximity test, regular expression test for all attributes
and a custom SQL-like search filter.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this object is equal to the specified object.Returns the string based search expression.
If empty, then search expression is not used.Returns the geometry used for proximity search.Returns the projection to use for search geometry.Returns the regular expression used to search all the fields.
If empty, then the regular expression is not used.floatReturns the search radius for proximity search (in meters).inthashCode()Returns the hash value of this object.voidsetFilterExpression(String expr) Sets the string based search expression.
A various conditions based on the fields and geometry can be used.
For example, "name='X' OR (name='Y' AND gender IS NOT NULL)" is a valid expression,
assuming elements contains fields 'name' and 'gender'.
Note: This feature is currently in experimental state and may change in the future!voidsetGeometry(Geometry geometry) Sets the geometry used for proximity search.
If geometry is set, then projection must be also defined.voidsetProjection(Projection projection) Sets the projection to use for search geometry.voidsetRegexFilter(String regex) Sets the regular expression used to search all the fields.voidsetSearchRadius(float radius) Sets the search radius for proximity search (in meters).toString()Creates a string representation of this request object, useful for logging.
-
Constructor Details
-
SearchRequest
public SearchRequest()Constructs an empty SearchRequest.
-
-
Method Details
-
equals
Checks if this object is equal to the specified object. -
hashCode
public int hashCode()Returns the hash value of this object. -
getFilterExpression
Returns the string based search expression.
If empty, then search expression is not used.- Returns:
- The string based search expression.
-
setFilterExpression
Sets the string based search expression.
A various conditions based on the fields and geometry can be used.
For example, "name='X' OR (name='Y' AND gender IS NOT NULL)" is a valid expression,
assuming elements contains fields 'name' and 'gender'.
Note: This feature is currently in experimental state and may change in the future!- Parameters:
expr- The string based expression to use.
-
getRegexFilter
Returns the regular expression used to search all the fields.
If empty, then the regular expression is not used.- Returns:
- The regular expression used to search all the fields.
-
setRegexFilter
Sets the regular expression used to search all the fields.- Parameters:
regex- The regular expression to use.
-
getGeometry
Returns the geometry used for proximity search.- Returns:
- The geometry used for proximity search.
-
setGeometry
Sets the geometry used for proximity search.
If geometry is set, then projection must be also defined.- Parameters:
geometry- The geometry used for proximity search.
-
getProjection
Returns the projection to use for search geometry.- Returns:
- The projection to use for search geometry.
-
setProjection
Sets the projection to use for search geometry.- Parameters:
projection- The projection to use for search geometry.
-
getSearchRadius
public float getSearchRadius()Returns the search radius for proximity search (in meters). The default is 0.- Returns:
- The proximity search radius in meters.
-
setSearchRadius
public void setSearchRadius(float radius) Sets the search radius for proximity search (in meters). The default is 0.- Parameters:
radius- The proximity search radius in meters.
-
toString
Creates a string representation of this request object, useful for logging.
-