如何在solr中对动态字段进行镶嵌面处理

如何在solr中对动态字段进行镶嵌面处理,solr,Solr,我们使用的是Solr7.5,我们已经为products属性实现了动态字段,现在我们在动态字段上实现方面遇到了问题 following are the product documents for the dynamic field <dynamicField name="*_attribute" type="text_general" multiValued="true" indexed="true" stored="true"/> { "product_slno":"1", "p

我们使用的是Solr7.5,我们已经为products属性实现了动态字段,现在我们在动态字段上实现方面遇到了问题

following are the product documents for the dynamic field

<dynamicField name="*_attribute" type="text_general" multiValued="true" indexed="true" stored="true"/>

{
"product_slno":"1",
"product_name":["baby doll"],
"text":["baby doll"],
"color_attribute":["red1"],
"type_attribute":["xyz1"],
"material_attribute":["plastic1"],
"_version_":1660058653347020800},
{
"product_slno":"2",
"product_name":["babydoll"],
"text":["babydoll"],
"color_attribute":["red"],
"style_attribute":["xyz"],
"material_attribute":["plastic"],
"_version_":1660058653383720960
},

for example if we want to get the color_attribute value for entire document the we are not able to geet it.

and we do not have the fixed attribute for any products so we are trying to use dynamic fields

please help
以下是动态字段的产品文档
{
“产品编号”:“1”,
“产品名称”:[“娃娃”],
“文本”:[“娃娃”],
“颜色属性”:[“红色1”],
“类型_属性”:[“xyz1”],
“材料属性”:[“塑料1”],
“U版本”:1660058653347020800},
{
“产品编号”:“2”,
“产品名称”:[“babydoll”],
“文本”:[“babydoll”],
“颜色属性”:[“红色”],
“样式属性”:[“xyz”],
“材料属性”:[“塑料”],
“u版本”:1660058653383720960
},
例如,如果我们想要获取整个文档的color_属性值,我们就无法获取它。
我们没有任何产品的固定属性,所以我们尝试使用动态字段
请帮忙

您需要更改
刻面
字段的字段类型。 如果您使用字符串作为字段类型,这将是很好的
faceting
字段。 标记化不适合刻面。当您将
文本\u概述
用于您的字段时。你需要换同样的

因为字符串类型将没有文本的
标记化
,并用作
刻面
的单个标记

您可以有一个单独的字段,如下所示,用于刻面

<dynamicField name="*_facet_attribute" type="string" multiValued="true" indexed="true" stored="true"/>


您可以将其作为动态字段或普通字段。

为面使用
text\u general
字段不是一个好主意,因为它们将被标记化(即
深黄色
将被分为
黄色
)。除此之外,动态场没有什么特别之处。您可以在
color\u属性上刻面,就像在任何其他字段上刻面一样。非常感谢,我想做的是使用(facet.field=*)获取动态字段的所有刻面计数有没有其他方法可以这样做/solr/products/select?q=product\u name:babydoll&rows=0&facet=true&facet.limit=500&facet.mincount=1&facet.field=*&indent=a据我所知,
facet.field
不支持通配符。但是,在某些地方,您可能有关于动态字段可以存在的元数据(在您自己的应用程序中);我将提取这些内容并为每个内容创建单独的
facet.field
条目。如果您想排除基于标记的过滤器,这也将允许您对它们进行适当的标记(这样您就可以使总方面计数独立于应用于搜索结果本身的过滤器)。非常感谢,现在我已经将其从“text_general”改为“string”,我想做的是使用(facet.field=)是否可以这样做,或者还有其他方法/solr/products/select?q=product\u name:babydoll&rows=0&facet=true&facet.limit=500&facet.mincount=1&facet.field=*&indent=on