Solr 9.8 では、`facet.field` に `PathHierarchyTokenizer` を使用する場合、`facet.method=enum` を指定する必要があります

トピック作成者:ks-solruserml-bot (2025/04/30 10:23 投稿)
2
(The bot translated the original post https://lists.apache.org/thread/gzdth0w63yr65g5scfgfgcvmkc0r05r9 into Japanese and reposted it under Apache License 2.0. The copyright of posted content is held by the original poster.)
こんにちは、
なぜ facet.method=enum
パラメータを指定しないと、Solr 9.8 では facet.field
に PathHierarchyTokenizer
を使用したファセットが動作しないのでしょうか?
以下が詳細です:
- フィールドタイプ:
<fieldType name="path_hierarchy" class="solr.TextField">
<analyzer type="index">
<tokenizer name="pathHierarchy" delimiter="/"/>
</analyzer>
<analyzer type="query">
<tokenizer name="keyword"/>
</analyzer>
</fieldType>
- フィールド:
<field name="category_path" type="path_hierarchy" indexed="true" stored="false" required="false" multiValued="false"/>
- インデックスデータ:
[
{
"id": "1",
"category_path": "foo/bar/baz"
}
]
facet.method=enum
を指定しないクエリ:
curl "http://localhost:8983/solr/core/select?q=*:*&facet=true&facet.field=category_path"
結果:
"facet_counts":{
"facet_queries":{ },
"facet_fields":{
"category_path":[ ]
},
"facet_ranges":{ },
"facet_intervals":{ },
"facet_heatmaps":{ }
}
facet.method=enum
を指定したクエリ:
curl "http://localhost:8983/solr/core/select?q=*:*&facet=true&facet.field=category_path&facet.method=enum"
結果:
"facet_counts":{
"facet_queries":{ },
"facet_fields":{
"category_path":["foo",1,"foo/bar",1,"foo/bar/baz",1]
},
"facet_ranges":{ },
"facet_intervals":{ },
"facet_heatmaps":{ }
}
よろしくお願いします。
Mingchun
トピックへ返信するには、ログインが必要です。