@@ -1203,7 +1203,7 @@ func TestClient_InfoSchemaFields(t *testing.T) {
1203
1203
Options : NumericFieldOptions {
1204
1204
Sortable : false ,
1205
1205
NoIndex : false ,
1206
- As : "" ,
1206
+ As : "age " ,
1207
1207
},
1208
1208
}
1209
1209
assert .True (t , reflect .DeepEqual (expNumericField , info .Schema .Fields [0 ]))
@@ -1225,7 +1225,9 @@ func TestClient_InfoFieldsTest(t *testing.T) {
1225
1225
schema := NewSchema (DefaultOptions ).
1226
1226
AddField (NewTextFieldOptions ("text" , TextFieldOptions {Sortable : true , PhoneticMatcher : PhoneticDoubleMetaphoneEnglish })).
1227
1227
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" }))
1229
1231
// In this example we will only index keys started by product:
1230
1232
indexDefinition := NewIndexDefinition ().AddPrefix ("ft-info-fields-test:" )
1231
1233
// Add the Index Definition
@@ -1238,8 +1240,11 @@ func TestClient_InfoFieldsTest(t *testing.T) {
1238
1240
assert .Equal (t ,
1239
1241
[]Field (
1240
1242
[]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
+ }),
1244
1249
info .Schema .Fields )
1245
1250
}
0 commit comments