Add semantic search and new fields mapping#24
Conversation
# Conflicts: # internal/clients/kcp/searchindex_resolver_test.go
| if end > total { | ||
| end = total | ||
| } | ||
| end := min(start+chunkSize, total) |
| return nil, fmt.Errorf("no active SearchIndex resources found for org %q", org) | ||
| } | ||
|
|
||
| sort.Slice(refs, func(i, j int) bool { |
There was a problem hiding this comment.
Why do we need to sort here? Doesn't OpenSearch sort it for us? Even if we take out items the order should be preserved.
There was a problem hiding this comment.
This sort is only for deterministic ordering after listing SearchIndex CRs from KCP, not for OpenSearch result ordering.
| return out | ||
| } | ||
|
|
||
| func prefixedFields(prefix string, fields []string) []string { |
There was a problem hiding this comment.
Are those prefixes related to semantic and exact fields or something else?
There was a problem hiding this comment.
Both as all (searchable) fields are prefixed now.
| return SearchResponse{}, fmt.Errorf("%w: filters require a resource", ErrInvalidRequest) | ||
| } | ||
|
|
||
| if mode == SearchModeSemantic && resource == "" { |
There was a problem hiding this comment.
Is the mode for an entire query semantic as soon as one semantic fields is included in the query? I'm thinking of a query within two fields where one is semantic and the other one isn't.
There was a problem hiding this comment.
Right now it's a dedicated mode that a user has to activate. But you are right we should maybe change this.
This PR changes the following:
Refers to https://github.com/platform-mesh/search-operator/issues/17