File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 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 &
128128 rankingScoreThreshold ?: number ;
129129 attributesToSearchOn ?: string [ ] | null ;
130130 hybrid ?: HybridSearch ;
131+ distinct ?: string ;
131132 } ;
132133
133134// Search parameters for searches made with the GET method
@@ -148,6 +149,7 @@ export type SearchRequestGET = Pagination &
148149 hybridEmbedder ?: string ;
149150 hybridSemanticRatio ?: number ;
150151 rankingScoreThreshold ?: number ;
152+ distinct ?: string ;
151153 } ;
152154
153155export type MultiSearchQuery = SearchParams & { indexUid : string } ;
Original file line number Diff line number Diff line change @@ -511,6 +511,15 @@ describe.each([
511511 expect ( response2 . hits . length ) . toBeLessThanOrEqual ( 0 ) ;
512512 } ) ;
513513
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+
514523 test ( `${ permission } key: Try to search on deleted index and fail` , async ( ) => {
515524 const client = await getClient ( permission ) ;
516525 const masterClient = await getClient ( 'Master' ) ;
Original file line number Diff line number Diff line change @@ -911,6 +911,15 @@ describe.each([
911911 expect ( response ) . not . toHaveProperty ( 'semanticHitCount' ) ;
912912 } ) ;
913913
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+
914923 test ( `${ permission } key: Try to search on deleted index and fail` , async ( ) => {
915924 const client = await getClient ( permission ) ;
916925 const masterClient = await getClient ( 'Master' ) ;
You can’t perform that action at this time.
0 commit comments