public class

SearchRequest

extends Object
java.lang.Object
   ↳ com.carto.search.SearchRequest

Class Overview

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.

Summary

Public Constructors
SearchRequest()
Constructs an empty SearchRequest.
Public Methods
synchronized void delete()
boolean equals(Object obj)
Checks if this object is equal to the specified object.
String getFilterExpression()
Returns the string based search expression.
Geometry getGeometry()
Returns the geometry used for proximity search.
Projection getProjection()
Returns the projection to use for search geometry.
String getRegexFilter()
Returns the regular expression used to search all the fields.
float getSearchRadius()
Returns the search radius for proximity search (in meters).
int hashCode()
Returns the hash value of this object.
void setFilterExpression(String expr)
Sets the string based search expression.
void setGeometry(Geometry geometry)
Sets the geometry used for proximity search.
void setProjection(Projection projection)
Sets the projection to use for search geometry.
void setRegexFilter(String regex)
Sets the regular expression used to search all the fields.
void setSearchRadius(float radius)
Sets the search radius for proximity search (in meters).
String toString()
Creates a string representation of this request object, useful for logging.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SearchRequest ()

Constructs an empty SearchRequest.

Public Methods

public synchronized void delete ()

public boolean equals (Object obj)

Checks if this object is equal to the specified object.

Parameters
obj The reference object.
Returns
  • True when objects are equal, false otherwise.

public String getFilterExpression ()

Returns the string based search expression.
If empty, then search expression is not used.

Returns
  • The string based search expression.

public Geometry getGeometry ()

Returns the geometry used for proximity search.

Returns
  • The geometry used for proximity search.

public Projection getProjection ()

Returns the projection to use for search geometry.

Returns
  • The projection to use for search geometry.

public String 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.

public float getSearchRadius ()

Returns the search radius for proximity search (in meters). The default is 0.

Returns
  • The proximity search radius in meters.

public int hashCode ()

Returns the hash value of this object.

Returns
  • The hash value of this object.

public void setFilterExpression (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!

Parameters
expr The string based expression to use.

public void setGeometry (Geometry geometry)

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.

public void setProjection (Projection projection)

Sets the projection to use for search geometry.

Parameters
projection The projection to use for search geometry.

public void setRegexFilter (String regex)

Sets the regular expression used to search all the fields.

Parameters
regex The regular expression to use.

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.

public String toString ()

Creates a string representation of this request object, useful for logging.

Returns
  • The string representation of this request object.