Skip to content

Commit b33c7b0

Browse files
clemfromspacealgolia-ci
and
algolia-ci
authored
chore: update search api specs (#157)
Co-authored-by: algolia-ci <[email protected]>
1 parent 3529a4c commit b33c7b0

File tree

2 files changed

+35
-33
lines changed

2 files changed

+35
-33
lines changed

api/specs/search.yml

+29-27
Original file line numberDiff line numberDiff line change
@@ -3423,20 +3423,6 @@ components:
34233423
example: (category:Book OR category:Ebook) AND _tags:published
34243424
x-categories:
34253425
- Filtering
3426-
searchFiltersArrayString:
3427-
title: search filter array
3428-
type: array
3429-
items:
3430-
type: string
3431-
mixedSearchFilters:
3432-
oneOf:
3433-
- $ref: '#/components/schemas/searchFiltersArrayString'
3434-
- type: string
3435-
listOfSearchFilters:
3436-
type: array
3437-
title: search filters
3438-
items:
3439-
$ref: '#/components/schemas/mixedSearchFilters'
34403426
facetFilters:
34413427
description: >
34423428
Filter the search by facet values, so that only records with the same
@@ -3465,7 +3451,9 @@ components:
34653451
- category:-Movie
34663452
- author:John Doe
34673453
oneOf:
3468-
- $ref: '#/components/schemas/listOfSearchFilters'
3454+
- type: array
3455+
items:
3456+
$ref: '#/components/schemas/facetFilters'
34693457
- type: string
34703458
x-categories:
34713459
- Filtering
@@ -3493,7 +3481,9 @@ components:
34933481
- category:Book
34943482
- author:John Doe
34953483
oneOf:
3496-
- $ref: '#/components/schemas/listOfSearchFilters'
3484+
- type: array
3485+
items:
3486+
$ref: '#/components/schemas/optionalFilters'
34973487
- type: string
34983488
x-categories:
34993489
- Filtering
@@ -3519,7 +3509,9 @@ components:
35193509
- deliveryDate < 1441755506
35203510
- price < 1000
35213511
oneOf:
3522-
- $ref: '#/components/schemas/listOfSearchFilters'
3512+
- type: array
3513+
items:
3514+
$ref: '#/components/schemas/numericFilters'
35233515
- type: string
35243516
x-categories:
35253517
- Filtering
@@ -3544,7 +3536,9 @@ components:
35443536
- Movie
35453537
- SciFi
35463538
oneOf:
3547-
- $ref: '#/components/schemas/listOfSearchFilters'
3539+
- type: array
3540+
items:
3541+
$ref: '#/components/schemas/tagFilters'
35483542
- type: string
35493543
x-categories:
35503544
- Filtering
@@ -4423,11 +4417,12 @@ components:
44234417
Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/)
44244418
to records that match these filters.
44254419
oneOf:
4426-
- $ref: '#/components/schemas/listOfSearchFilters'
4420+
- type: array
4421+
items:
4422+
$ref: '#/components/schemas/reRankingApplyFilter'
44274423
- type: string
44284424
x-categories:
44294425
- Filtering
4430-
- type: 'null'
44314426
indexSettingsAsSearchParams:
44324427
type: object
44334428
additionalProperties: false
@@ -5075,7 +5070,9 @@ components:
50755070
x-categories:
50765071
- Filtering
50775072
reRankingApplyFilter:
5078-
$ref: '#/components/schemas/reRankingApplyFilter'
5073+
oneOf:
5074+
- $ref: '#/components/schemas/reRankingApplyFilter'
5075+
- type: 'null'
50795076
searchParamsObject:
50805077
title: Search parameters as object
50815078
description: >-
@@ -5088,10 +5085,6 @@ components:
50885085
oneOf:
50895086
- $ref: '#/components/schemas/searchParamsString'
50905087
- $ref: '#/components/schemas/searchParamsObject'
5091-
exhaustiveFacetsCount:
5092-
type: boolean
5093-
description: See the `facetsCount` field of the `exhaustive` object in the response.
5094-
deprecated: true
50955088
nbHits:
50965089
type: integer
50975090
description: Number of results (hits).
@@ -5223,7 +5216,11 @@ components:
52235216
alternatives exist for the query). This field will not be
52245217
included when typo-tolerance is entirely disabled.
52255218
exhaustiveFacetsCount:
5226-
$ref: '#/components/schemas/exhaustiveFacetsCount'
5219+
type: boolean
5220+
description: >-
5221+
See the `facetsCount` field of the `exhaustive` object in the
5222+
response.
5223+
deprecated: true
52275224
exhaustiveNbHits:
52285225
type: boolean
52295226
description: See the `nbHits` field of the `exhaustive` object in the response.
@@ -5705,7 +5702,12 @@ components:
57055702
approximated](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
57065703
type: integer
57075704
exhaustiveFacetsCount:
5708-
$ref: '#/components/schemas/exhaustiveFacetsCount'
5705+
type: boolean
5706+
description: >
5707+
Whether the facet count is exhaustive (true) or approximate (false).
5708+
5709+
For more information, see [Why are my facet and hit counts not
5710+
accurate](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
57095711
processingTimeMS:
57105712
$ref: '#/components/schemas/processingTimeMS'
57115713
searchResult:

pkg/cmdutil/spec_flags.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/queryType/`))
417417
cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results.
418418
See: https://www.algolia.com/doc/api-reference/api-parameters/ranking/`))
419419
cmd.Flags().SetAnnotation("ranking", "Categories", []string{"Ranking"})
420-
reRankingApplyFilter := NewJSONVar([]string{"array", "string", "null"}...)
421-
cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`Restrict Dynamic Re-Ranking to records that match these filters.`))
420+
reRankingApplyFilter := NewJSONVar([]string{"", "null"}...)
421+
cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`.`))
422422
cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results.
423423
See: https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/`))
424424
cmd.Flags().SetAnnotation("relevancyStrictness", "Categories", []string{"Ranking"})
@@ -640,8 +640,8 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/queryType/`))
640640
cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results.
641641
See: https://www.algolia.com/doc/api-reference/api-parameters/ranking/`))
642642
cmd.Flags().SetAnnotation("ranking", "Categories", []string{"Ranking"})
643-
reRankingApplyFilter := NewJSONVar([]string{"array", "string", "null"}...)
644-
cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`Restrict Dynamic Re-Ranking to records that match these filters.`))
643+
reRankingApplyFilter := NewJSONVar([]string{"", "null"}...)
644+
cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`.`))
645645
cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results.
646646
See: https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/`))
647647
cmd.Flags().SetAnnotation("relevancyStrictness", "Categories", []string{"Ranking"})
@@ -870,8 +870,8 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/queryType/`))
870870
cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results.
871871
See: https://www.algolia.com/doc/api-reference/api-parameters/ranking/`))
872872
cmd.Flags().SetAnnotation("ranking", "Categories", []string{"Ranking"})
873-
reRankingApplyFilter := NewJSONVar([]string{"array", "string", "null"}...)
874-
cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`Restrict Dynamic Re-Ranking to records that match these filters.`))
873+
reRankingApplyFilter := NewJSONVar([]string{"", "null"}...)
874+
cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`.`))
875875
cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results.
876876
See: https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/`))
877877
cmd.Flags().SetAnnotation("relevancyStrictness", "Categories", []string{"Ranking"})

0 commit comments

Comments
 (0)