@@ -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,9 @@ 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" }))
12291231 // In this example we will only index keys started by product:
12301232 indexDefinition := NewIndexDefinition ().AddPrefix ("ft-info-fields-test:" )
12311233 // Add the Index Definition
@@ -1238,8 +1240,11 @@ func TestClient_InfoFieldsTest(t *testing.T) {
12381240 assert .Equal (t ,
12391241 []Field (
12401242 []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 : "" }}}),
1243+ Field {Name : "text" , Type : 0 , Sortable : true , Options : TextFieldOptions {Weight : 1 , Sortable : true , NoStem : false , NoIndex : false , PhoneticMatcher : "" , As : "text" }},
1244+ Field {Name : "geo" , Type : 2 , Sortable : false , Options : GeoFieldOptions {As : "geo" , NoIndex : false }},
1245+ Field {Name : "numeric" , Type : 1 , Sortable : false , Options : NumericFieldOptions {Sortable : false , NoIndex : false , As : "numeric" }},
1246+ Field {Name : "alias_type" , Type : 0 , Sortable : true , Options : TextFieldOptions {Weight : 1 , Sortable : true , NoStem : true , NoIndex : true , PhoneticMatcher : "" , As : "type" }},
1247+ Field {Name : "address_city" , Type : 3 , Sortable : false , Options : TagFieldOptions {Separator : 44 , NoIndex : false , Sortable : false , CaseSensitive : false , As : "city" }},
1248+ }),
12441249 info .Schema .Fields )
12451250}
0 commit comments