Skip to content

Commit e99b277

Browse files
authored
Fix search attributes sample (#405)
1 parent d012243 commit e99b277

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

searchattributes/searchattributes_workflow.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func SearchAttributesWorkflow(ctx workflow.Context) error {
6060
"CustomBoolField": true,
6161
"CustomDoubleField": 3.14,
6262
"CustomDatetimeField": workflow.Now(ctx).UTC(),
63-
"CustomStringField": "String field is for text. When query, it will be tokenized for partial match. StringTypeField cannot be used in Order By",
63+
"CustomStringField": "String field is for text. When query, it will be tokenized for partial match.",
6464
}
6565
// This won't persist search attributes on server because commands are not sent to server,
6666
// but local cache will be updated.
@@ -104,7 +104,7 @@ func SearchAttributesWorkflow(ctx workflow.Context) error {
104104
StartToCloseTimeout: 10 * time.Second,
105105
}
106106
ctx = workflow.WithActivityOptions(ctx, ao)
107-
query := "CustomIntField=2 AND CustomKeywordField='Update2' ORDER BY CustomDatetimeField DESC"
107+
query := "CustomIntField=2 AND CustomKeywordField='Update2'"
108108
var listResults []*workflowpb.WorkflowExecutionInfo
109109
err = workflow.ExecuteActivity(ctx, ListExecutions, query).Get(ctx, &listResults)
110110
if err != nil {

searchattributes/searchattributes_workflow_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func Test_Workflow(t *testing.T) {
2525
"CustomBoolField": true,
2626
"CustomDoubleField": 3.14,
2727
"CustomDatetimeField": env.Now().UTC(),
28-
"CustomStringField": "String field is for text. When query, it will be tokenized for partial match. StringTypeField cannot be used in Order By",
28+
"CustomStringField": "String field is for text. When query, it will be tokenized for partial match.",
2929
}
3030
//lint:ignore SA1019 typed alternative available, leaving this for reference
3131
env.OnUpsertSearchAttributes(attributes).Return(nil).Once()

0 commit comments

Comments
 (0)