@@ -1203,7 +1203,7 @@ func TestClient_InfoSchemaFields(t *testing.T) {
12031203 Options : NumericFieldOptions {
12041204 Sortable : false ,
12051205 NoIndex : false ,
1206- As : "" ,
1206+ As : "age " ,
12071207 },
12081208 }
12091209 assert .True (t , reflect .DeepEqual (expNumericField , info .Schema .Fields [0 ]))
@@ -1225,7 +1225,10 @@ func TestClient_InfoFieldsTest(t *testing.T) {
12251225 schema := NewSchema (DefaultOptions ).
12261226 AddField (NewTextFieldOptions ("text" , TextFieldOptions {Sortable : true , PhoneticMatcher : PhoneticDoubleMetaphoneEnglish })).
12271227 AddField (NewGeoField ("geo" )).
1228- AddField (NewNumericField ("numeric" ))
1228+ AddField (NewNumericField ("numeric" )).
1229+ AddField (NewTextFieldOptions ("alias_type" , TextFieldOptions {As : "type" , Sortable : true , NoIndex : true , NoStem : true })).
1230+ AddField (NewTagFieldOptions ("address_city" , TagFieldOptions {As : "city" })).
1231+ AddField (NewTagFieldOptions ("type" , TagFieldOptions {As : "tag" , Sortable : true , CaseSensitive : true , NoIndex : true }))
12291232 // In this example we will only index keys started by product:
12301233 indexDefinition := NewIndexDefinition ().AddPrefix ("ft-info-fields-test:" )
12311234 // Add the Index Definition
@@ -1238,8 +1241,12 @@ func TestClient_InfoFieldsTest(t *testing.T) {
12381241 assert .Equal (t ,
12391242 []Field (
12401243 []Field {
1241- Field {Name : "text" , Type : 0 , Sortable : false , Options : TextFieldOptions {Weight : 1 , Sortable : true , NoStem : false , NoIndex : false , PhoneticMatcher : "" , As : "" }},
1242- Field {Name : "geo" , Type : 2 , Sortable : false , Options : interface {}(nil )},
1243- Field {Name : "numeric" , Type : 1 , Sortable : false , Options : NumericFieldOptions {Sortable : false , NoIndex : false , As : "" }}}),
1244+ Field {Name : "text" , Type : 0 , Sortable : true , Options : TextFieldOptions {Weight : 1 , Sortable : true , NoStem : false , NoIndex : false , PhoneticMatcher : "" , As : "text" }},
1245+ Field {Name : "geo" , Type : 2 , Sortable : false , Options : GeoFieldOptions {As : "geo" , NoIndex : false }},
1246+ Field {Name : "numeric" , Type : 1 , Sortable : false , Options : NumericFieldOptions {Sortable : false , NoIndex : false , As : "numeric" }},
1247+ Field {Name : "alias_type" , Type : 0 , Sortable : true , Options : TextFieldOptions {Weight : 1 , Sortable : true , NoStem : true , NoIndex : true , PhoneticMatcher : "" , As : "type" }},
1248+ Field {Name : "address_city" , Type : 3 , Sortable : false , Options : TagFieldOptions {Separator : 44 , NoIndex : false , Sortable : false , CaseSensitive : false , As : "city" }},
1249+ Field {Name : "type" , Type : 3 , Sortable : true , Options : TagFieldOptions {Separator : 44 , NoIndex : true , Sortable : true , CaseSensitive : true , As : "tag" }},
1250+ }),
12441251 info .Schema .Fields )
12451252}
0 commit comments