因此,我已经成功创建了“包”对象的索引,并且直接的文本查询运行良好。
我很想知道是否/如何使用部分填充的对象(“包”类型)作为搜索条件?
包看起来像:
var packages = new List<Package> {
new Package {
Name = "Maverick",
TargetBusiness = new Business {
Industry = "Retail",
BusinessType = BusinessType.Product,
LocationType = LocationType.Store
},
Description = "Standard package for retail shops"
},
new Package {
Name = "Goose",
TargetBusiness = new Business {
Industry = "Retail",
BusinessType = BusinessType.Product,
LocationType = LocationType.Online
},
Description = "Standard package for ecommerce shops"
},
new Package {
Name = "Viper",
TargetBusiness = new Business {
Industry = "Advertising",
BusinessType = BusinessType.Service,
LocationType = LocationType.Office
},
Description = "Standard package test retail"
}
}
查询当前看起来像:
var result = client.Search<Package>(x => x.Query(q => q.QueryString(qs => qs.Query("q=retail"))));
但我喜欢有类似的东西:
var result = client.Search<Package>(x => x.Query(q => q.Object(new Package{...etc ...})));
我希望我说得通:D提前谢谢