Class BaseSearchParams

java.lang.Object
com.algolia.model.search.BaseSearchParams

public class BaseSearchParams extends Object
BaseSearchParams
  • Constructor Details

    • BaseSearchParams

      public BaseSearchParams()
  • Method Details

    • setQuery

      public BaseSearchParams setQuery(String query)
    • getQuery

      @Nullable public String getQuery()
      Search query.
    • setSimilarQuery

      public BaseSearchParams setSimilarQuery(String similarQuery)
    • getSimilarQuery

      @Nullable public String getSimilarQuery()
      Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery` parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
    • setFilters

      public BaseSearchParams setFilters(String filters)
    • getFilters

      @Nullable public String getFilters()
      Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** ` `, where `` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `: TO ` where `` and `` are the lower and upper limits of the range (inclusive). - **Facet filters.** `:` where `` is a facet attribute (case-sensitive) and `` a facet value. - **Tag filters.** `_tags:` or just `` (case-sensitive). - **Boolean filters.** `: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can't use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can't combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
    • setFacetFilters

      public BaseSearchParams setFacetFilters(FacetFilters facetFilters)
    • getFacetFilters

      @Nullable public FacetFilters getFacetFilters()
      Get facetFilters
    • setOptionalFilters

      public BaseSearchParams setOptionalFilters(OptionalFilters optionalFilters)
    • getOptionalFilters

      @Nullable public OptionalFilters getOptionalFilters()
      Get optionalFilters
    • setNumericFilters

      public BaseSearchParams setNumericFilters(NumericFilters numericFilters)
    • getNumericFilters

      @Nullable public NumericFilters getNumericFilters()
      Get numericFilters
    • setTagFilters

      public BaseSearchParams setTagFilters(TagFilters tagFilters)
    • getTagFilters

      @Nullable public TagFilters getTagFilters()
      Get tagFilters
    • setSumOrFiltersScores

      public BaseSearchParams setSumOrFiltersScores(Boolean sumOrFiltersScores)
    • getSumOrFiltersScores

      @Nullable public Boolean getSumOrFiltersScores()
      Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
    • setRestrictSearchableAttributes

      public BaseSearchParams setRestrictSearchableAttributes(List<String> restrictSearchableAttributes)
    • addRestrictSearchableAttributes

      public BaseSearchParams addRestrictSearchableAttributes(String restrictSearchableAttributesItem)
    • getRestrictSearchableAttributes

      @Nullable public List<String> getRestrictSearchableAttributes()
      Restricts a search to a subset of your searchable attributes.
    • setFacets

      public BaseSearchParams setFacets(List<String> facets)
    • addFacets

      public BaseSearchParams addFacets(String facetsItem)
    • getFacets

      @Nullable public List<String> getFacets()
      Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
    • setFacetingAfterDistinct

      public BaseSearchParams setFacetingAfterDistinct(Boolean facetingAfterDistinct)
    • getFacetingAfterDistinct

      @Nullable public Boolean getFacetingAfterDistinct()
      Whether faceting should be applied after deduplication with `distinct`. This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
    • setPage

      public BaseSearchParams setPage(Integer page)
    • getPage

      @Nullable public Integer getPage()
      Page of search results to retrieve. minimum: 0
    • setOffset

      public BaseSearchParams setOffset(Integer offset)
    • getOffset

      @Nullable public Integer getOffset()
      Position of the first hit to retrieve.
    • setLength

      public BaseSearchParams setLength(Integer length)
    • getLength

      @Nullable public Integer getLength()
      Number of hits to retrieve (used in combination with `offset`). minimum: 1 maximum: 1000
    • setAroundLatLng

      public BaseSearchParams setAroundLatLng(String aroundLatLng)
    • getAroundLatLng

      @Nullable public String getAroundLatLng()
      Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
    • setAroundLatLngViaIP

      public BaseSearchParams setAroundLatLngViaIP(Boolean aroundLatLngViaIP)
    • getAroundLatLngViaIP

      @Nullable public Boolean getAroundLatLngViaIP()
      Whether to obtain the coordinates from the request's IP address.
    • setAroundRadius

      public BaseSearchParams setAroundRadius(AroundRadius aroundRadius)
    • getAroundRadius

      @Nullable public AroundRadius getAroundRadius()
      Get aroundRadius
    • setAroundPrecision

      public BaseSearchParams setAroundPrecision(AroundPrecision aroundPrecision)
    • getAroundPrecision

      @Nullable public AroundPrecision getAroundPrecision()
      Get aroundPrecision
    • setMinimumAroundRadius

      public BaseSearchParams setMinimumAroundRadius(Integer minimumAroundRadius)
    • getMinimumAroundRadius

      @Nullable public Integer getMinimumAroundRadius()
      Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. minimum: 1
    • setInsideBoundingBox

      public BaseSearchParams setInsideBoundingBox(List<List<Double>> insideBoundingBox)
    • addInsideBoundingBox

      public BaseSearchParams addInsideBoundingBox(List<Double> insideBoundingBoxItem)
    • getInsideBoundingBox

      @Nullable public List<List<Double>> getInsideBoundingBox()
      Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
    • setInsidePolygon

      public BaseSearchParams setInsidePolygon(List<List<Double>> insidePolygon)
    • addInsidePolygon

      public BaseSearchParams addInsidePolygon(List<Double> insidePolygonItem)
    • getInsidePolygon

      @Nullable public List<List<Double>> getInsidePolygon()
      Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored, if you also specify `insideBoundingBox`.
    • setNaturalLanguages

      public BaseSearchParams setNaturalLanguages(List<String> naturalLanguages)
    • addNaturalLanguages

      public BaseSearchParams addNaturalLanguages(String naturalLanguagesItem)
    • getNaturalLanguages

      @Nullable public List<String> getNaturalLanguages()
      ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
    • setRuleContexts

      public BaseSearchParams setRuleContexts(List<String> ruleContexts)
    • addRuleContexts

      public BaseSearchParams addRuleContexts(String ruleContextsItem)
    • getRuleContexts

      @Nullable public List<String> getRuleContexts()
      Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
    • setPersonalizationImpact

      public BaseSearchParams setPersonalizationImpact(Integer personalizationImpact)
    • getPersonalizationImpact

      @Nullable public Integer getPersonalizationImpact()
      Impact that Personalization should have on this search. The higher this value is, the more Personalization determines the ranking compared to other factors. For more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact). minimum: 0 maximum: 100
    • setUserToken

      public BaseSearchParams setUserToken(String userToken)
    • getUserToken

      @Nullable public String getUserToken()
      Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
    • setGetRankingInfo

      public BaseSearchParams setGetRankingInfo(Boolean getRankingInfo)
    • getGetRankingInfo

      @Nullable public Boolean getGetRankingInfo()
      Whether the search response should include detailed ranking information.
    • setSynonyms

      public BaseSearchParams setSynonyms(Boolean synonyms)
    • getSynonyms

      @Nullable public Boolean getSynonyms()
      Whether to take into account an index's synonyms for this search.
    • setClickAnalytics

      public BaseSearchParams setClickAnalytics(Boolean clickAnalytics)
    • getClickAnalytics

      @Nullable public Boolean getClickAnalytics()
      Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
    • setAnalytics

      public BaseSearchParams setAnalytics(Boolean analytics)
    • getAnalytics

      @Nullable public Boolean getAnalytics()
      Whether this search will be included in Analytics.
    • setAnalyticsTags

      public BaseSearchParams setAnalyticsTags(List<String> analyticsTags)
    • addAnalyticsTags

      public BaseSearchParams addAnalyticsTags(String analyticsTagsItem)
    • getAnalyticsTags

      @Nullable public List<String> getAnalyticsTags()
      Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
    • setPercentileComputation

      public BaseSearchParams setPercentileComputation(Boolean percentileComputation)
    • getPercentileComputation

      @Nullable public Boolean getPercentileComputation()
      Whether to include this search when calculating processing-time percentiles.
    • setEnableABTest

      public BaseSearchParams setEnableABTest(Boolean enableABTest)
    • getEnableABTest

      @Nullable public Boolean getEnableABTest()
      Whether to enable A/B testing for this search.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object