使用 apache solr 的 facet 动态字段 [英] facet dynamic fields with apache solr
问题描述
我在 ApacheSolr 中定义了动态字段:
I have defined dynamic field in ApacheSolr:
我用它来存储产品特征,例如:颜色特征、直径特征、材料特征等.这些字段的数量不是恒定的,因为产品在变化.
I use it to store products features like: color_feature, diameter_feature, material_feature and so on. Number of those fields are not constant becouse products are changing.
是否可以使用相同的查询获得所有动态字段的分面结果,或者我是否需要始终在查询中编写所有字段,例如... facet.field=color_feature&facet.field=diameter_feature&facet.field=material_feature&facet.field=
...
Is it possible to get facet result for all those dynamic fields with the same query or do I need to write always all fields in a query like ... facet.field=color_feature&facet.field=diameter_feature&facet.field=material_feature&facet.field=
...
推荐答案
Solr 目前不支持 facet.field 参数中的通配符.
所以 *_feature
对你不起作用.
Solr currently does not support wildcards in the facet.field parameter.
So *_feature
won't work for you.
可能想检查一下 - https://issues.apache.org/jira/浏览/SOLR-247
如果您不想传递参数,您可以轻松地将这些添加到您的请求处理程序默认值中.
If you don't want to pass parameters, you can easily add these to your request handler defaults.
请求中的 qt=requesthandler
将始终包含这些方面.
The qt=requesthandler
in request would always include these facets.
这篇关于使用 apache solr 的 facet 动态字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!