如何指定多个 Spring Data Solr Facet Fields?
How to specify multiple Spring Data Solr Facet Fields?
根据 spring 数据 solr 文档,您可以使用注释或使用 solr 数据提供的 Java API 来指定构面字段。在注释中,您可以指定多个方面字段:
@Facet(fields = { "clientCode", "state", "productCode"}, limit = 10, minCount= 1)
示例 2.6。
// produces: f.name.facet.prefix=spring
FacetOptions options = new FacetOptions();
options.addFacetOnField(new FieldWithFacetParameters("name").setPrefix("spring"));
如何使用 FacetOptions 添加多个方面?
您似乎只能向查询添加一个 Facet。
您可以多次调用 addFacetOnField
方法以在多个字段上添加分面。
options.addFacetOnField(new FieldWithFacetParameters("name").setPrefix("spring"));
根据 spring 数据 solr 文档,您可以使用注释或使用 solr 数据提供的 Java API 来指定构面字段。在注释中,您可以指定多个方面字段:
@Facet(fields = { "clientCode", "state", "productCode"}, limit = 10, minCount= 1)
示例 2.6。
// produces: f.name.facet.prefix=spring
FacetOptions options = new FacetOptions();
options.addFacetOnField(new FieldWithFacetParameters("name").setPrefix("spring"));
如何使用 FacetOptions 添加多个方面?
您似乎只能向查询添加一个 Facet。
您可以多次调用 addFacetOnField
方法以在多个字段上添加分面。
options.addFacetOnField(new FieldWithFacetParameters("name").setPrefix("spring"));