|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.algolia.search.saas.Query
public class Query
Nested Class Summary | |
---|---|
static class |
Query.QueryType
|
static class |
Query.RemoveWordsType
|
static class |
Query.TypoTolerance
|
Field Summary | |
---|---|
protected boolean |
advancedSyntax
|
protected boolean |
allowTyposOnNumericTokens
|
protected boolean |
analytics
|
protected String |
aroundLatLong
|
protected boolean |
aroundLatLongViaIP
|
protected List<String> |
attributes
|
protected List<String> |
attributesToHighlight
|
protected List<String> |
attributesToSnippet
|
protected boolean |
distinct
|
protected String |
facetFilters
|
protected String |
facets
|
protected boolean |
getRankingInfo
|
protected int |
hitsPerPage
|
protected boolean |
ignorePlural
|
protected String |
insideBoundingBox
|
protected int |
maxNumberOfFacets
|
protected int |
minWordSizeForApprox1
|
protected int |
minWordSizeForApprox2
|
protected String |
numerics
|
protected String |
optionalWords
|
protected int |
page
|
protected String |
query
|
protected Query.QueryType |
queryType
|
protected Query.RemoveWordsType |
removeWordsIfNoResult
|
protected boolean |
replaceSynonyms
|
protected String |
restrictSearchableAttributes
|
protected boolean |
synonyms
|
protected String |
tags
|
protected Query.TypoTolerance |
typoTolerance
|
Constructor Summary | |
---|---|
Query()
|
|
Query(Query other)
|
|
Query(String query)
|
Method Summary | |
---|---|
Query |
aroundLatitudeLongitude(float latitude,
float longitude,
int radius)
Search for entries around a given latitude/longitude. |
Query |
aroundLatitudeLongitude(float latitude,
float longitude,
int radius,
int precision)
Search for entries around a given latitude/longitude. |
Query |
aroundLatitudeLongitudeViaIP(boolean enabled,
int radius)
Search for entries around the latitude/longitude of user (using IP geolocation) |
Query |
aroundLatitudeLongitudeViaIP(boolean enabled,
int radius,
int precision)
Search for entries around the latitude/longitude of user (using IP geolocation) |
Query |
enableAnalytics(boolean enabled)
|
Query |
enableAvancedSyntax(boolean advancedSyntax)
Enable the advanced query syntax. |
Query |
enableDistinct(boolean distinct)
|
Query |
enableReplaceSynonymsInHighlight(boolean enabled)
|
Query |
enableSynonyms(boolean enabled)
|
Query |
enableTyposOnNumericTokens(boolean enabled)
|
Query |
enableTypoTolerance(boolean enabled)
|
String |
getAroundLatLong()
|
List<String> |
getAttributes()
|
List<String> |
getAttributesToHighlight()
|
List<String> |
getAttributesToSnippet()
|
String |
getFacetFilters()
|
String |
getFacets()
|
int |
getHitsPerPage()
|
String |
getInsideBoundingBox()
|
int |
getMaxNumberOfFacets()
|
int |
getMinWordSizeForApprox1()
|
int |
getMinWordSizeForApprox2()
|
String |
getNumerics()
|
String |
getOptionalWords()
|
int |
getPage()
|
String |
getQuery()
|
protected String |
getQueryString()
|
Query.QueryType |
getQueryType()
|
Query |
getRankingInfo(boolean enabled)
if set, the result hits will contain ranking information in _rankingInfo attribute. |
Query.RemoveWordsType |
getRemoveWordsIfNoResult()
|
String |
getRestrictSearchableAttributes()
|
String |
getTags()
|
Query.TypoTolerance |
getTypoTolerance()
|
Query |
ignorePlural(boolean enabled)
If set to true, plural won't be considered as a typo (for example car/cars will be considered as equals). |
Query |
insideBoundingBox(float latitudeP1,
float longitudeP1,
float latitudeP2,
float longitudeP2)
Search for entries inside a given area defined by the two extreme points of a rectangle. |
boolean |
isAdvancedSyntax()
|
boolean |
isAllowTyposOnNumericTokens()
|
boolean |
isAnalytics()
|
boolean |
isAroundLatLongViaIP()
|
boolean |
isDistinct()
|
boolean |
isGetRankingInfo()
|
boolean |
isIgnorePlural()
|
boolean |
isReplaceSynonyms()
|
boolean |
isSynonyms()
|
Query |
removeWordsIfNoResult(Query.RemoveWordsType type)
Select the strategy to adopt when a query does not return any result. |
Query |
restrictSearchableAttributes(String attributes)
List of object attributes you want to use for textual search (must be a subset of the attributesToIndex index setting). |
Query |
setAttributesToHighlight(List<String> attributes)
Specify the list of attribute names to highlight. |
Query |
setAttributesToRetrieve(List<String> attributes)
Specify the list of attribute names to retrieve. |
Query |
setAttributesToSnippet(List<String> attributes)
Specify the list of attribute names to Snippet alongside the number of words to return (syntax is 'attributeName:nbWords'). |
Query |
setFacetFilters(List<String> facets)
Filter the query by a list of facets. |
Query |
setFacetFilters(String facetFilters)
Filter the query by a list of facets. |
Query |
setFacets(List<String> facets)
List of object attributes that you want to use for faceting. |
Query |
setHitsPerPage(int nbHitsPerPage)
Set the number of hits per page. |
Query |
setMaxNumberOfFacets(int n)
Limit the number of facet values returned for each facet. |
Query |
setMinWordSizeToAllowOneTypo(int nbChars)
Specify the minimum number of characters in a query word to accept one typo in this word. |
Query |
setMinWordSizeToAllowTwoTypos(int nbChars)
Specify the minimum number of characters in a query word to accept two typos in this word. |
Query |
setNbHitsPerPage(int nbHitsPerPage)
Deprecated. Use setHitsPerPage |
Query |
setNumericFilters(List<String> numerics)
Add a list of numeric filters separated by a comma. |
Query |
setNumericFilters(String numerics)
Add a list of numeric filters separated by a comma. |
Query |
setOptionalWords(List<String> words)
Set the list of words that should be considered as optional when found in the query. |
Query |
setOptionalWords(String words)
Set the list of words that should be considered as optional when found in the query. |
Query |
setPage(int page)
Set the page to retrieve (zero base). |
Query |
setQueryString(String query)
Set the full text query |
Query |
setQueryType(Query.QueryType type)
Select how the query words are interpreted: |
Query |
setTagFilters(String tags)
Filter the query by a set of tags. |
Query |
setTypoTolerance(Query.TypoTolerance typoTolerance)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List<String> attributes
protected List<String> attributesToHighlight
protected List<String> attributesToSnippet
protected int minWordSizeForApprox1
protected int minWordSizeForApprox2
protected boolean getRankingInfo
protected boolean ignorePlural
protected boolean distinct
protected boolean advancedSyntax
protected int page
protected int hitsPerPage
protected String restrictSearchableAttributes
protected String tags
protected String numerics
protected String insideBoundingBox
protected String aroundLatLong
protected boolean aroundLatLongViaIP
protected String query
protected Query.QueryType queryType
protected String optionalWords
protected String facets
protected String facetFilters
protected int maxNumberOfFacets
protected boolean analytics
protected boolean synonyms
protected boolean replaceSynonyms
protected boolean allowTyposOnNumericTokens
protected Query.RemoveWordsType removeWordsIfNoResult
protected Query.TypoTolerance typoTolerance
Constructor Detail |
---|
public Query(String query)
public Query()
public Query(Query other)
Method Detail |
---|
public Query removeWordsIfNoResult(Query.RemoveWordsType type)
public Query restrictSearchableAttributes(String attributes)
public Query setQueryType(Query.QueryType type)
public Query setQueryString(String query)
public Query setAttributesToRetrieve(List<String> attributes)
public Query setAttributesToHighlight(List<String> attributes)
public Query setAttributesToSnippet(List<String> attributes)
public Query enableDistinct(boolean distinct)
If
- set to true, enable the distinct feature (disabled by default) if the attributeForDistinct index setting is set.
This feature is similar to the SQL "distinct" keyword: when enabled in a query with the distinct=1 parameter,
all hits containing a duplicate value for the attributeForDistinct attribute are removed from results.
For example, if the chosen attribute is show_name and several hits have the same value for show_name, then only the best
one is kept and others are removed.public Query enableAnalytics(boolean enabled)
If
- set to false, this query will not be taken into account in analytics feature. Default to true.public Query enableSynonyms(boolean enabled)
If
- set to false, this query will not use synonyms defined in configuration. Default to true.public Query enableReplaceSynonymsInHighlight(boolean enabled)
If
- set to false, words matched via synonyms expansion will not be replaced by the matched synonym in highlight result. Default to true.public Query enableTypoTolerance(boolean enabled)
If
- set to false, disable typo-tolerance. Default to true.public Query setTypoTolerance(Query.TypoTolerance typoTolerance)
This
- option allow to control the number of typo in the results set.public Query setMinWordSizeToAllowOneTypo(int nbChars)
public Query setMinWordSizeToAllowTwoTypos(int nbChars)
public Query enableTyposOnNumericTokens(boolean enabled)
If
- set to false, disable typo-tolerance on numeric tokens. Default to true.public Query getRankingInfo(boolean enabled)
public Query ignorePlural(boolean enabled)
public Query setPage(int page)
public Query setHitsPerPage(int nbHitsPerPage)
@Deprecated public Query setNbHitsPerPage(int nbHitsPerPage)
setHitsPerPage
public Query aroundLatitudeLongitude(float latitude, float longitude, int radius)
radius
- set the maximum distance in meters.
Note: at indexing, geoloc of an object should be set with _geoloc attribute containing lat and lng attributes (for example {"_geoloc":{"lat":48.853409, "lng":2.348800}})public Query aroundLatitudeLongitude(float latitude, float longitude, int radius, int precision)
radius
- set the maximum distance in meters.precision
- set the precision for ranking (for example if you set precision=100, two objects that are distant of less than 100m will be considered as identical for "geo" ranking parameter).
Note: at indexing, geoloc of an object should be set with _geoloc attribute containing lat and lng attributes (for example {"_geoloc":{"lat":48.853409, "lng":2.348800}})public Query aroundLatitudeLongitudeViaIP(boolean enabled, int radius)
radius
- set the maximum distance in meters.
Note: at indexing, geoloc of an object should be set with _geoloc attribute containing lat and lng attributes (for example {"_geoloc":{"lat":48.853409, "lng":2.348800}})public Query aroundLatitudeLongitudeViaIP(boolean enabled, int radius, int precision)
radius
- set the maximum distance in meters.precision
- set the precision for ranking (for example if you set precision=100, two objects that are distant of less than 100m will be considered as identical for "geo" ranking parameter).
Note: at indexing, geoloc of an object should be set with _geoloc attribute containing lat and lng attributes (for example {"_geoloc":{"lat":48.853409, "lng":2.348800}})public Query insideBoundingBox(float latitudeP1, float longitudeP1, float latitudeP2, float longitudeP2)
public Query setOptionalWords(String words)
words
- The list of optional words, comma separated.public Query setOptionalWords(List<String> words)
words
- The list of optional words.public Query setFacetFilters(List<String> facets)
public Query setFacetFilters(String facetFilters)
public Query setFacets(List<String> facets)
public Query setMaxNumberOfFacets(int n)
public Query setTagFilters(String tags)
public Query setNumericFilters(String numerics)
public Query setNumericFilters(List<String> numerics)
public Query enableAvancedSyntax(boolean advancedSyntax)
protected String getQueryString()
public List<String> getAttributes()
public List<String> getAttributesToHighlight()
public List<String> getAttributesToSnippet()
public int getMinWordSizeForApprox1()
public int getMinWordSizeForApprox2()
public boolean isGetRankingInfo()
public boolean isIgnorePlural()
public boolean isDistinct()
public boolean isAdvancedSyntax()
public int getPage()
public int getHitsPerPage()
public String getRestrictSearchableAttributes()
public String getTags()
public String getNumerics()
public String getInsideBoundingBox()
public String getAroundLatLong()
public boolean isAroundLatLongViaIP()
public String getQuery()
public Query.QueryType getQueryType()
public String getOptionalWords()
public String getFacets()
public String getFacetFilters()
public int getMaxNumberOfFacets()
public boolean isAnalytics()
public boolean isSynonyms()
public boolean isReplaceSynonyms()
public boolean isAllowTyposOnNumericTokens()
public Query.RemoveWordsType getRemoveWordsIfNoResult()
public Query.TypoTolerance getTypoTolerance()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |