Skip to content

Commit

Permalink
fix(specs): mixed SearchParams and IndexSettings (#1889)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Aug 9, 2023
1 parent a9caae9 commit 5a9d949
Show file tree
Hide file tree
Showing 6 changed files with 727 additions and 626 deletions.
2 changes: 1 addition & 1 deletion .github/.cache_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.8
0.0.9
78 changes: 43 additions & 35 deletions specs/common/schemas/IndexSettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,6 @@ indexSettingsAsSearchParams:
default: ['*']
x-categories:
- Attributes
restrictSearchableAttributes:
type: array
items:
type: string
example: ['title','author']
description: Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
default: []
x-categories:
- Attributes
ranking:
type: array
items:
Expand Down Expand Up @@ -315,18 +306,7 @@ indexSettingsAsSearchParams:
mode:
$ref: '#/mode'
semanticSearch:
type: object
description: >
Settings for the semantic search part of NeuralSearch.
Only used when `mode` is _neuralSearch_.
properties:
eventSources:
description: Indices from which to collect click and conversion events. If null, the current index and replica group will be used as the event source.
nullable: true
type: array
items:
type: string

$ref: '#/semanticSearch'
advancedSyntax:
type: boolean
description: Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax).
Expand Down Expand Up @@ -369,26 +349,12 @@ indexSettingsAsSearchParams:
default: [exactPhrase, excludeWords]
x-categories:
- Query strategy
explain:
type: array
items:
type: string
description: Enriches the API's response with information about how the query was processed.
default: []
x-categories:
- Query strategy
distinct:
$ref: '#/distinct'
attributeForDistinct:
description: Name of the deduplication attribute to be used with Algolia's [_distinct_ feature](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature).
example: 'url'
type: string
synonyms:
type: boolean
description: Whether to take into account an index's synonyms for a particular search.
default: true
x-categories:
- Advanced
replaceSynonymsInHighlight:
type: boolean
description: Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
Expand All @@ -413,6 +379,18 @@ indexSettingsAsSearchParams:
- Advanced
maxFacetHits:
$ref: '#/maxFacetHits'
maxValuesPerFacet:
type: integer
description: Maximum number of facet values to return for each facet.
default: 100
x-categories:
- Faceting
sortFacetValuesBy:
type: string
description: Controls how facet values are fetched.
default: count
x-categories:
- Faceting
attributeCriteriaComputedByMinProximity:
type: boolean
description: When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage.
Expand All @@ -421,6 +399,14 @@ indexSettingsAsSearchParams:
- Advanced
renderingContent:
$ref: '#/renderingContent'
enableReRanking:
type: boolean
description: Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
default: true
x-categories:
- Filtering
reRankingApplyFilter:
$ref: '#/reRankingApplyFilter'

maxFacetHits:
type: integer
Expand All @@ -430,6 +416,15 @@ maxFacetHits:
x-categories:
- Advanced

reRankingApplyFilter:
description: When [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) is enabled, only records that match these filters will be affected by Dynamic Re-Ranking.
nullable: true
oneOf:
- $ref: './SearchParams.yml#/listOfSearchFilters'
- type: string
x-categories:
- Filtering

hitsPerPage:
type: integer
description: Number of hits per page.
Expand Down Expand Up @@ -613,3 +608,16 @@ sortRemainingBy:
- `hidden`: show only pinned values.
type: string
enum: [count, alpha, hidden]

semanticSearch:
type: object
description: >
Settings for the semantic search part of NeuralSearch.
Only used when `mode` is _neuralSearch_.
properties:
eventSources:
description: Indices from which to collect click and conversion events. If null, the current index and replica group will be used as the event source.
nullable: true
type: array
items:
type: string
52 changes: 23 additions & 29 deletions specs/common/schemas/SearchParams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ baseSearchParamsWithoutQuery:
default: false
x-categories:
- Filtering
restrictSearchableAttributes:
type: array
items:
type: string
example: ['title','author']
description: Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
default: []
x-categories:
- Filtering
facets:
type: array
items:
Expand All @@ -59,25 +68,13 @@ baseSearchParamsWithoutQuery:
default: []
x-categories:
- Faceting
maxValuesPerFacet:
type: integer
description: Maximum number of facet values to return for each facet.
default: 100
x-categories:
- Faceting
facetingAfterDistinct:
type: boolean
description: >
Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control.
default: false
x-categories:
- Faceting
sortFacetValuesBy:
type: string
description: Controls how facet values are fetched.
default: count
x-categories:
- Faceting
page:
$ref: '#/page'
offset:
Expand Down Expand Up @@ -150,6 +147,20 @@ baseSearchParamsWithoutQuery:
default: false
x-categories:
- Advanced
explain:
type: array
items:
type: string
description: Enriches the API's response with information about how the query was processed.
default: []
x-categories:
- Advanced
synonyms:
type: boolean
description: Whether to take into account an index's synonyms for a particular search.
default: true
x-categories:
- Advanced
clickAnalytics:
type: boolean
description: Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests).
Expand Down Expand Up @@ -182,14 +193,6 @@ baseSearchParamsWithoutQuery:
default: true
x-categories:
- Advanced
enableReRanking:
type: boolean
description: Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
default: true
x-categories:
- Advanced
reRankingApplyFilter:
$ref: '#/reRankingApplyFilter'

searchParamsString:
type: object
Expand Down Expand Up @@ -323,15 +326,6 @@ facetFilters:
x-categories:
- Filtering

reRankingApplyFilter:
description: When [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) is enabled, only records that match these filters will be affected by Dynamic Re-Ranking.
nullable: true
oneOf:
- $ref: '#/listOfSearchFilters'
- type: string
x-categories:
- Filtering

tagFilters:
description: >
[Filter hits by tags](https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/).
Expand Down
Loading

0 comments on commit 5a9d949

Please sign in to comment.