Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions integration/index_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,26 @@ func TestIndex_FacetSearch(t *testing.T) {
},
wantErr: false,
},
{
name: "TestIndexFacetSearchWithFilterArray",
args: args{
UID: "indexUID",
client: sv,
request: &meilisearch.FacetSearchRequest{
FacetName: "tag",
FacetQuery: "Novel",
Filter: []string{"tag = Novel"},
},
filterableAttributes: []interface{}{"tag"},
},
want: &meilisearch.FacetSearchResponse{
FacetHits: meilisearch.Hits{
{"value": toRawMessage("Novel"), "count": toRawMessage(5)},
},
FacetQuery: "Novel",
},
wantErr: false,
},
}

for _, tt := range tests {
Expand Down
5 changes: 4 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ type SearchRequest struct {
ShowMatchesPosition bool `json:"showMatchesPosition,omitempty"`
ShowRankingScore bool `json:"showRankingScore,omitempty"`
ShowRankingScoreDetails bool `json:"showRankingScoreDetails,omitempty"`
ShowPerformanceDetails bool `json:"showPerformanceDetails,omitempty"`
Facets []string `json:"facets,omitempty"`
Sort []string `json:"sort,omitempty"`
Vector []float32 `json:"vector,omitempty"`
Expand Down Expand Up @@ -596,6 +597,7 @@ type SearchResponse struct {
FacetStats json.RawMessage `json:"facetStats,omitempty"`
IndexUID string `json:"indexUid,omitempty"`
QueryVector *[]float32 `json:"queryVector,omitempty"`
PerformanceDetails json.RawMessage `json:"performanceDetails,omitempty"`
}

type MultiSearchResponse struct {
Expand All @@ -622,7 +624,7 @@ type FacetSearchRequest struct {
FacetName string `json:"facetName,omitempty"`
FacetQuery string `json:"facetQuery,omitempty"`
Q string `json:"q,omitempty"`
Filter string `json:"filter,omitempty"`
Filter interface{} `json:"filter,omitempty"`
MatchingStrategy string `json:"matchingStrategy,omitempty"`
AttributesToSearchOn []string `json:"attributesToSearchOn,omitempty"`
ExhaustiveFacetCount bool `json:"exhaustiveFacetCount,omitempty"`
Expand Down Expand Up @@ -661,6 +663,7 @@ type SimilarDocumentQuery struct {
Filter string `json:"filter,omitempty"`
ShowRankingScore bool `json:"showRankingScore,omitempty"`
ShowRankingScoreDetails bool `json:"showRankingScoreDetails,omitempty"`
ShowPerformanceDetails bool `json:"showPerformanceDetails,omitempty"`
RankingScoreThreshold float64 `json:"rankingScoreThreshold,omitempty"`
RetrieveVectors bool `json:"retrieveVectors,omitempty"`
}
Expand Down
Loading