diff --git a/lib/Api/SearchClient.php b/lib/Api/SearchClient.php index ecf3a761..7d8ddd96 100644 --- a/lib/Api/SearchClient.php +++ b/lib/Api/SearchClient.php @@ -817,7 +817,7 @@ public function deleteApiKey($key, $requestOptions = []) * - $deleteByParams['tagFilters'] => (array) * - $deleteByParams['aroundLatLng'] => (string) Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a 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`. * - $deleteByParams['aroundRadius'] => (array) - * - $deleteByParams['insideBoundingBox'] => (array) 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). + * - $deleteByParams['insideBoundingBox'] => (array) * - $deleteByParams['insidePolygon'] => (array) 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`. * * @see DeleteByParams diff --git a/lib/Model/Recommend/FallbackParams.php b/lib/Model/Recommend/FallbackParams.php index 2f2edd59..24c0ab8d 100644 --- a/lib/Model/Recommend/FallbackParams.php +++ b/lib/Model/Recommend/FallbackParams.php @@ -35,7 +35,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Recommend\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Recommend\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -66,6 +66,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => 'object', 'customNormalization' => 'array>', 'attributeForDistinct' => 'string', + 'maxFacetHits' => 'int', 'attributesToRetrieve' => 'string[]', 'ranking' => 'string[]', 'relevancyStrictness' => 'int', @@ -89,7 +90,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'queryType' => '\Algolia\AlgoliaSearch\Model\Recommend\QueryType', 'removeWordsIfNoResults' => '\Algolia\AlgoliaSearch\Model\Recommend\RemoveWordsIfNoResults', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Recommend\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Recommend\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Recommend\AlternativesAsExact[]', @@ -98,7 +99,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -128,7 +128,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -159,6 +159,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => null, 'customNormalization' => null, 'attributeForDistinct' => null, + 'maxFacetHits' => null, 'attributesToRetrieve' => null, 'ranking' => null, 'relevancyStrictness' => null, @@ -191,7 +192,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -253,6 +253,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => 'userData', 'customNormalization' => 'customNormalization', 'attributeForDistinct' => 'attributeForDistinct', + 'maxFacetHits' => 'maxFacetHits', 'attributesToRetrieve' => 'attributesToRetrieve', 'ranking' => 'ranking', 'relevancyStrictness' => 'relevancyStrictness', @@ -285,7 +286,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -346,6 +346,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => 'setUserData', 'customNormalization' => 'setCustomNormalization', 'attributeForDistinct' => 'setAttributeForDistinct', + 'maxFacetHits' => 'setMaxFacetHits', 'attributesToRetrieve' => 'setAttributesToRetrieve', 'ranking' => 'setRanking', 'relevancyStrictness' => 'setRelevancyStrictness', @@ -378,7 +379,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -439,6 +439,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => 'getUserData', 'customNormalization' => 'getCustomNormalization', 'attributeForDistinct' => 'getAttributeForDistinct', + 'maxFacetHits' => 'getMaxFacetHits', 'attributesToRetrieve' => 'getAttributesToRetrieve', 'ranking' => 'getRanking', 'relevancyStrictness' => 'getRelevancyStrictness', @@ -471,7 +472,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -632,6 +632,9 @@ public function __construct(?array $data = null) if (isset($data['attributeForDistinct'])) { $this->container['attributeForDistinct'] = $data['attributeForDistinct']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['attributesToRetrieve'])) { $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; } @@ -728,9 +731,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1186,7 +1186,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1196,7 +1196,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -1927,6 +1927,30 @@ public function setAttributeForDistinct($attributeForDistinct) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets attributesToRetrieve. * @@ -2482,7 +2506,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2492,7 +2516,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2695,30 +2719,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/lib/Model/Recommend/InsideBoundingBox.php b/lib/Model/Recommend/InsideBoundingBox.php new file mode 100644 index 00000000..109c266c --- /dev/null +++ b/lib/Model/Recommend/InsideBoundingBox.php @@ -0,0 +1,188 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Recommend/OptionalWords.php b/lib/Model/Recommend/OptionalWords.php new file mode 100644 index 00000000..bda029ed --- /dev/null +++ b/lib/Model/Recommend/OptionalWords.php @@ -0,0 +1,188 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Recommend/RecommendSearchParams.php b/lib/Model/Recommend/RecommendSearchParams.php index a5bf051a..a32d7d40 100644 --- a/lib/Model/Recommend/RecommendSearchParams.php +++ b/lib/Model/Recommend/RecommendSearchParams.php @@ -37,7 +37,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Recommend\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Recommend\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -68,6 +68,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => 'object', 'customNormalization' => 'array>', 'attributeForDistinct' => 'string', + 'maxFacetHits' => 'int', 'attributesToRetrieve' => 'string[]', 'ranking' => 'string[]', 'relevancyStrictness' => 'int', @@ -91,7 +92,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'queryType' => '\Algolia\AlgoliaSearch\Model\Recommend\QueryType', 'removeWordsIfNoResults' => '\Algolia\AlgoliaSearch\Model\Recommend\RemoveWordsIfNoResults', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Recommend\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Recommend\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Recommend\AlternativesAsExact[]', @@ -100,7 +101,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -130,7 +130,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -161,6 +161,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => null, 'customNormalization' => null, 'attributeForDistinct' => null, + 'maxFacetHits' => null, 'attributesToRetrieve' => null, 'ranking' => null, 'relevancyStrictness' => null, @@ -193,7 +194,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -255,6 +255,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => 'userData', 'customNormalization' => 'customNormalization', 'attributeForDistinct' => 'attributeForDistinct', + 'maxFacetHits' => 'maxFacetHits', 'attributesToRetrieve' => 'attributesToRetrieve', 'ranking' => 'ranking', 'relevancyStrictness' => 'relevancyStrictness', @@ -287,7 +288,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -348,6 +348,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => 'setUserData', 'customNormalization' => 'setCustomNormalization', 'attributeForDistinct' => 'setAttributeForDistinct', + 'maxFacetHits' => 'setMaxFacetHits', 'attributesToRetrieve' => 'setAttributesToRetrieve', 'ranking' => 'setRanking', 'relevancyStrictness' => 'setRelevancyStrictness', @@ -380,7 +381,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -441,6 +441,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => 'getUserData', 'customNormalization' => 'getCustomNormalization', 'attributeForDistinct' => 'getAttributeForDistinct', + 'maxFacetHits' => 'getMaxFacetHits', 'attributesToRetrieve' => 'getAttributesToRetrieve', 'ranking' => 'getRanking', 'relevancyStrictness' => 'getRelevancyStrictness', @@ -473,7 +474,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -634,6 +634,9 @@ public function __construct(?array $data = null) if (isset($data['attributeForDistinct'])) { $this->container['attributeForDistinct'] = $data['attributeForDistinct']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['attributesToRetrieve'])) { $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; } @@ -730,9 +733,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1188,7 +1188,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1198,7 +1198,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -1929,6 +1929,30 @@ public function setAttributeForDistinct($attributeForDistinct) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets attributesToRetrieve. * @@ -2484,7 +2508,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2494,7 +2518,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2697,30 +2721,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/lib/Model/Search/BrowseParams.php b/lib/Model/Search/BrowseParams.php index 6840ddbc..fef8b568 100644 --- a/lib/Model/Search/BrowseParams.php +++ b/lib/Model/Search/BrowseParams.php @@ -40,7 +40,7 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -126,7 +125,7 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -176,7 +175,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -263,7 +261,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -349,7 +346,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -435,7 +431,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -669,9 +664,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1250,7 +1242,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1260,7 +1252,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2234,7 +2226,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2244,7 +2236,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2447,30 +2439,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/lib/Model/Search/BrowseParamsObject.php b/lib/Model/Search/BrowseParamsObject.php index d86addef..6a3d37a2 100644 --- a/lib/Model/Search/BrowseParamsObject.php +++ b/lib/Model/Search/BrowseParamsObject.php @@ -39,7 +39,7 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -80,7 +80,7 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -89,7 +89,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -124,7 +123,7 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -174,7 +173,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -260,7 +258,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -345,7 +342,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -430,7 +426,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -661,9 +656,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1218,7 +1210,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1228,7 +1220,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2202,7 +2194,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2212,7 +2204,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2415,30 +2407,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/lib/Model/Search/ConsequenceParams.php b/lib/Model/Search/ConsequenceParams.php index b6a3a06b..9c60d751 100644 --- a/lib/Model/Search/ConsequenceParams.php +++ b/lib/Model/Search/ConsequenceParams.php @@ -38,7 +38,7 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -79,7 +79,7 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -88,7 +88,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -124,7 +123,7 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -174,7 +173,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -261,7 +259,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -347,7 +344,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -433,7 +429,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -663,9 +658,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1202,7 +1194,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1212,7 +1204,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2186,7 +2178,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2196,7 +2188,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2399,30 +2391,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/lib/Model/Search/DeleteByParams.php b/lib/Model/Search/DeleteByParams.php index 2b9f2d6f..46a30b70 100644 --- a/lib/Model/Search/DeleteByParams.php +++ b/lib/Model/Search/DeleteByParams.php @@ -26,7 +26,7 @@ class DeleteByParams extends AbstractModel implements ModelInterface, \ArrayAcce 'tagFilters' => '\Algolia\AlgoliaSearch\Model\Search\TagFilters', 'aroundLatLng' => 'string', 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', ]; @@ -42,7 +42,7 @@ class DeleteByParams extends AbstractModel implements ModelInterface, \ArrayAcce 'tagFilters' => null, 'aroundLatLng' => null, 'aroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', ]; @@ -354,7 +354,7 @@ public function setAroundRadius($aroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -364,7 +364,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ diff --git a/lib/Model/Search/IndexSettings.php b/lib/Model/Search/IndexSettings.php index 68e816a1..a82482af 100644 --- a/lib/Model/Search/IndexSettings.php +++ b/lib/Model/Search/IndexSettings.php @@ -39,6 +39,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => 'object', 'customNormalization' => 'array>', 'attributeForDistinct' => 'string', + 'maxFacetHits' => 'int', 'attributesToRetrieve' => 'string[]', 'ranking' => 'string[]', 'customRanking' => 'string[]', @@ -67,7 +68,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -76,7 +77,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -108,6 +108,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => null, 'customNormalization' => null, 'attributeForDistinct' => null, + 'maxFacetHits' => null, 'attributesToRetrieve' => null, 'ranking' => null, 'customRanking' => null, @@ -145,7 +146,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -178,6 +178,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => 'userData', 'customNormalization' => 'customNormalization', 'attributeForDistinct' => 'attributeForDistinct', + 'maxFacetHits' => 'maxFacetHits', 'attributesToRetrieve' => 'attributesToRetrieve', 'ranking' => 'ranking', 'customRanking' => 'customRanking', @@ -215,7 +216,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -247,6 +247,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => 'setUserData', 'customNormalization' => 'setCustomNormalization', 'attributeForDistinct' => 'setAttributeForDistinct', + 'maxFacetHits' => 'setMaxFacetHits', 'attributesToRetrieve' => 'setAttributesToRetrieve', 'ranking' => 'setRanking', 'customRanking' => 'setCustomRanking', @@ -284,7 +285,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -316,6 +316,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => 'getUserData', 'customNormalization' => 'getCustomNormalization', 'attributeForDistinct' => 'getAttributeForDistinct', + 'maxFacetHits' => 'getMaxFacetHits', 'attributesToRetrieve' => 'getAttributesToRetrieve', 'ranking' => 'getRanking', 'customRanking' => 'getCustomRanking', @@ -353,7 +354,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -427,6 +427,9 @@ public function __construct(?array $data = null) if (isset($data['attributeForDistinct'])) { $this->container['attributeForDistinct'] = $data['attributeForDistinct']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['attributesToRetrieve'])) { $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; } @@ -538,9 +541,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1041,6 +1041,30 @@ public function setAttributeForDistinct($attributeForDistinct) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets attributesToRetrieve. * @@ -1716,7 +1740,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -1726,7 +1750,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -1929,30 +1953,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/lib/Model/Search/InsideBoundingBox.php b/lib/Model/Search/InsideBoundingBox.php new file mode 100644 index 00000000..630c76c9 --- /dev/null +++ b/lib/Model/Search/InsideBoundingBox.php @@ -0,0 +1,188 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Search/OptionalWords.php b/lib/Model/Search/OptionalWords.php new file mode 100644 index 00000000..4af9fdbe --- /dev/null +++ b/lib/Model/Search/OptionalWords.php @@ -0,0 +1,188 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Search/SearchForFacets.php b/lib/Model/Search/SearchForFacets.php index 2334b3fc..d2f75847 100644 --- a/lib/Model/Search/SearchForFacets.php +++ b/lib/Model/Search/SearchForFacets.php @@ -40,7 +40,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -100,6 +99,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => 'string', 'indexName' => 'string', 'facetQuery' => 'string', + 'maxFacetHits' => 'int', 'type' => '\Algolia\AlgoliaSearch\Model\Search\SearchTypeFacet', ]; @@ -129,7 +129,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -179,7 +179,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -189,6 +188,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => null, 'indexName' => null, 'facetQuery' => null, + 'maxFacetHits' => null, 'type' => null, ]; @@ -269,7 +269,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -279,6 +278,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => 'facet', 'indexName' => 'indexName', 'facetQuery' => 'facetQuery', + 'maxFacetHits' => 'maxFacetHits', 'type' => 'type', ]; @@ -358,7 +358,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -368,6 +367,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => 'setFacet', 'indexName' => 'setIndexName', 'facetQuery' => 'setFacetQuery', + 'maxFacetHits' => 'setMaxFacetHits', 'type' => 'setType', ]; @@ -447,7 +447,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -457,6 +456,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => 'getFacet', 'indexName' => 'getIndexName', 'facetQuery' => 'getFacetQuery', + 'maxFacetHits' => 'getMaxFacetHits', 'type' => 'getType', ]; @@ -684,9 +684,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -714,6 +711,9 @@ public function __construct(?array $data = null) if (isset($data['facetQuery'])) { $this->container['facetQuery'] = $data['facetQuery']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['type'])) { $this->container['type'] = $data['type']; } @@ -1286,7 +1286,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1296,7 +1296,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2270,7 +2270,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2280,7 +2280,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2483,30 +2483,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * @@ -2723,6 +2699,30 @@ public function setFacetQuery($facetQuery) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets type. * diff --git a/lib/Model/Search/SearchForHits.php b/lib/Model/Search/SearchForHits.php index 289d602d..053b2820 100644 --- a/lib/Model/Search/SearchForHits.php +++ b/lib/Model/Search/SearchForHits.php @@ -40,7 +40,7 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -127,7 +126,7 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -177,7 +176,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -265,7 +263,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -352,7 +349,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -439,7 +435,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -674,9 +669,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1264,7 +1256,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1274,7 +1266,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2248,7 +2240,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2258,7 +2250,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2461,30 +2453,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/lib/Model/Search/SearchParams.php b/lib/Model/Search/SearchParams.php index b693c9db..a0a60d73 100644 --- a/lib/Model/Search/SearchParams.php +++ b/lib/Model/Search/SearchParams.php @@ -40,7 +40,7 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -125,7 +124,7 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -175,7 +174,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -261,7 +259,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -346,7 +343,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -431,7 +427,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -664,9 +659,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1242,7 +1234,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1252,7 +1244,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2226,7 +2218,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2236,7 +2228,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2439,30 +2431,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/lib/Model/Search/SearchParamsObject.php b/lib/Model/Search/SearchParamsObject.php index be82b36b..a52ea64f 100644 --- a/lib/Model/Search/SearchParamsObject.php +++ b/lib/Model/Search/SearchParamsObject.php @@ -41,7 +41,7 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -82,7 +82,7 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -91,7 +91,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -125,7 +124,7 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -175,7 +174,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -260,7 +258,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -344,7 +341,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -428,7 +424,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -658,9 +653,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1212,7 +1204,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1222,7 +1214,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2196,7 +2188,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2206,7 +2198,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2409,30 +2401,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/lib/Model/Search/SearchQuery.php b/lib/Model/Search/SearchQuery.php index 9e485910..fd900e5c 100644 --- a/lib/Model/Search/SearchQuery.php +++ b/lib/Model/Search/SearchQuery.php @@ -40,7 +40,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -101,6 +100,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => '\Algolia\AlgoliaSearch\Model\Search\SearchTypeFacet', 'facet' => 'string', 'facetQuery' => 'string', + 'maxFacetHits' => 'int', ]; /** @@ -129,7 +129,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -179,7 +179,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -190,6 +189,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => null, 'facet' => null, 'facetQuery' => null, + 'maxFacetHits' => null, ]; /** @@ -269,7 +269,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -280,6 +279,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => 'type', 'facet' => 'facet', 'facetQuery' => 'facetQuery', + 'maxFacetHits' => 'maxFacetHits', ]; /** @@ -358,7 +358,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -369,6 +368,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => 'setType', 'facet' => 'setFacet', 'facetQuery' => 'setFacetQuery', + 'maxFacetHits' => 'setMaxFacetHits', ]; /** @@ -447,7 +447,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -458,6 +457,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => 'getType', 'facet' => 'getFacet', 'facetQuery' => 'getFacetQuery', + 'maxFacetHits' => 'getMaxFacetHits', ]; /** @@ -684,9 +684,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -717,6 +714,9 @@ public function __construct(?array $data = null) if (isset($data['facetQuery'])) { $this->container['facetQuery'] = $data['facetQuery']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } } /** @@ -1286,7 +1286,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1296,7 +1296,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2270,7 +2270,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2280,7 +2280,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2483,30 +2483,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * @@ -2747,6 +2723,30 @@ public function setFacetQuery($facetQuery) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/Search/SettingsResponse.php b/lib/Model/Search/SettingsResponse.php index 982830ad..718d9cce 100644 --- a/lib/Model/Search/SettingsResponse.php +++ b/lib/Model/Search/SettingsResponse.php @@ -37,6 +37,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => 'object', 'customNormalization' => 'array>', 'attributeForDistinct' => 'string', + 'maxFacetHits' => 'int', 'attributesToRetrieve' => 'string[]', 'ranking' => 'string[]', 'customRanking' => 'string[]', @@ -65,7 +66,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -74,7 +75,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -107,6 +107,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => null, 'customNormalization' => null, 'attributeForDistinct' => null, + 'maxFacetHits' => null, 'attributesToRetrieve' => null, 'ranking' => null, 'customRanking' => null, @@ -144,7 +145,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -178,6 +178,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => 'userData', 'customNormalization' => 'customNormalization', 'attributeForDistinct' => 'attributeForDistinct', + 'maxFacetHits' => 'maxFacetHits', 'attributesToRetrieve' => 'attributesToRetrieve', 'ranking' => 'ranking', 'customRanking' => 'customRanking', @@ -215,7 +216,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -248,6 +248,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => 'setUserData', 'customNormalization' => 'setCustomNormalization', 'attributeForDistinct' => 'setAttributeForDistinct', + 'maxFacetHits' => 'setMaxFacetHits', 'attributesToRetrieve' => 'setAttributesToRetrieve', 'ranking' => 'setRanking', 'customRanking' => 'setCustomRanking', @@ -285,7 +286,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -318,6 +318,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => 'getUserData', 'customNormalization' => 'getCustomNormalization', 'attributeForDistinct' => 'getAttributeForDistinct', + 'maxFacetHits' => 'getMaxFacetHits', 'attributesToRetrieve' => 'getAttributesToRetrieve', 'ranking' => 'getRanking', 'customRanking' => 'getCustomRanking', @@ -355,7 +356,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -430,6 +430,9 @@ public function __construct(?array $data = null) if (isset($data['attributeForDistinct'])) { $this->container['attributeForDistinct'] = $data['attributeForDistinct']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['attributesToRetrieve'])) { $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; } @@ -541,9 +544,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1047,6 +1047,30 @@ public function setAttributeForDistinct($attributeForDistinct) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets attributesToRetrieve. * @@ -1722,7 +1746,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -1732,7 +1756,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -1935,30 +1959,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. *