File tree 3 files changed +20
-0
lines changed
3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ export type SearchParams = Query &
128
128
rankingScoreThreshold ?: number ;
129
129
attributesToSearchOn ?: string [ ] | null ;
130
130
hybrid ?: HybridSearch ;
131
+ distinct ?: string ;
131
132
} ;
132
133
133
134
// Search parameters for searches made with the GET method
@@ -148,6 +149,7 @@ export type SearchRequestGET = Pagination &
148
149
hybridEmbedder ?: string ;
149
150
hybridSemanticRatio ?: number ;
150
151
rankingScoreThreshold ?: number ;
152
+ distinct ?: string ;
151
153
} ;
152
154
153
155
export type MultiSearchQuery = SearchParams & { indexUid : string } ;
Original file line number Diff line number Diff line change @@ -511,6 +511,15 @@ describe.each([
511
511
expect ( response2 . hits . length ) . toBeLessThanOrEqual ( 0 ) ;
512
512
} ) ;
513
513
514
+ test ( `${ permission } key: search with distinct` , async ( ) => {
515
+ const client = await getClient ( permission ) ;
516
+ const response = await client
517
+ . index ( index . uid )
518
+ . search ( '' , { distinct : 'genre' } ) ;
519
+
520
+ expect ( response . hits . length ) . toEqual ( 4 ) ;
521
+ } ) ;
522
+
514
523
test ( `${ permission } key: Try to search on deleted index and fail` , async ( ) => {
515
524
const client = await getClient ( permission ) ;
516
525
const masterClient = await getClient ( 'Master' ) ;
Original file line number Diff line number Diff line change @@ -911,6 +911,15 @@ describe.each([
911
911
expect ( response ) . not . toHaveProperty ( 'semanticHitCount' ) ;
912
912
} ) ;
913
913
914
+ test ( `${ permission } key: search with distinct` , async ( ) => {
915
+ const client = await getClient ( permission ) ;
916
+ const response = await client
917
+ . index ( index . uid )
918
+ . search ( '' , { distinct : 'genre' } ) ;
919
+
920
+ expect ( response . hits . length ) . toEqual ( 4 ) ;
921
+ } ) ;
922
+
914
923
test ( `${ permission } key: Try to search on deleted index and fail` , async ( ) => {
915
924
const client = await getClient ( permission ) ;
916
925
const masterClient = await getClient ( 'Master' ) ;
You can’t perform that action at this time.
0 commit comments