Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: Add dsl log field for HybridSearch #39584

Merged
Merged
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
17 changes: 17 additions & 0 deletions internal/proxy/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"fmt"
"os"
"strconv"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -3285,6 +3286,21 @@
return rsp, err
}

type hybridSearchRequestExprLogger struct {
*milvuspb.HybridSearchRequest
}

// String implements Stringer interface for lazy logging.
func (l *hybridSearchRequestExprLogger) String() string {
builder := &strings.Builder{}

for idx, subReq := range l.Requests {
builder.WriteString(fmt.Sprintf("[No.%d req, expr: %s]", idx, subReq.GetDsl()))
}

Check warning on line 3299 in internal/proxy/impl.go

View check run for this annotation

Codecov / codecov/patch

internal/proxy/impl.go#L3294-L3299

Added lines #L3294 - L3299 were not covered by tests

return builder.String()

Check warning on line 3301 in internal/proxy/impl.go

View check run for this annotation

Codecov / codecov/patch

internal/proxy/impl.go#L3301

Added line #L3301 was not covered by tests
}

func (node *Proxy) hybridSearch(ctx context.Context, request *milvuspb.HybridSearchRequest, optimizedSearch bool) (*milvuspb.SearchResults, bool, bool, error) {
metrics.GetStats(ctx).
SetNodeID(paramtable.GetNodeID()).
Expand Down Expand Up @@ -3337,6 +3353,7 @@
zap.Any("OutputFields", request.OutputFields),
zap.String("ConsistencyLevel", request.GetConsistencyLevel().String()),
zap.Bool("useDefaultConsistency", request.GetUseDefaultConsistency()),
zap.Stringer("dsls", &hybridSearchRequestExprLogger{HybridSearchRequest: request}),
)

defer func() {
Expand Down
Loading