unified-storage: restrict search to title of documents (#111842)
* restrict search to title of documents
This commit is contained in:
@@ -164,14 +164,18 @@ func runTestResourceIndex(t *testing.T, backend resource.SearchBackend, nsPrefix
|
||||
Group: ns.Group,
|
||||
Resource: ns.Resource,
|
||||
},
|
||||
Fields: []*resourcepb.Requirement{{
|
||||
Key: "tags",
|
||||
Operator: "=",
|
||||
Values: []string{"tag3"},
|
||||
}},
|
||||
},
|
||||
Fields: []string{"title", "folder", "tags"},
|
||||
Query: "tag3",
|
||||
Limit: 10,
|
||||
}, nil)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, resp)
|
||||
require.Equal(t, int64(1), resp.TotalHits) // Only doc3 should have tag3 now
|
||||
require.Equal(t, int64(1), resp.TotalHits) // Only doc2 should have tag3 now
|
||||
|
||||
// Search for Document
|
||||
resp, err = index.Search(ctx, nil, &resourcepb.ResourceSearchRequest{
|
||||
|
||||
Reference in New Issue
Block a user