Hello,
I do not know why Nested Facets (
https://solr.apache.org/guide/8_11/json-facet-api.html#nested-facets) does
not work for _txt_sort field (SortableTextField).
To reproduce the problem,
I created a new collection (Config set: _default) and add the following to
the collection
{
"name_txt_sort": ["Amelia Harris"],
"name_txt": ["Amelia Harris"],
"sex_s": "female"
},
{
"name_txt_sort": ["Olivia Wilson"],
"name_txt": ["Olivia Wilson"],
"sex_s": "female"
},
{
"name_txt_sort": ["George Smith"],
"name_txt": ["George Smith"],
"sex_s": "male"
}
If my query is:
{
"query": "*:*",
"facet": {
"categories": {
"type": "terms",
"field": "name_txt",
"limit": -1,
"facet": {
"sex_s": {
"type": "terms",
"field": "sex_s",
"limit": -1
}
}
}
}
}
The output is correct:
============================
"facets":{
"count":3,
"categories":{
"buckets":[{
"val":"amelia",
"count":1,
"sex_s":{
"buckets":[{
"val":"female",
"count":1}]}},
{
"val":"george",
"count":1,
...
============================
However, if I change
"field": "name_txt"
to
"field": "name_txt_sort"
in my query, only one level group result is shown:
================================
"facets":{
"count":3,
"categories":{
"buckets":[{
"val":"Amelia Harris",
"count":1},
{
"val":"George Smith",
"count":1},
{
"val":"Olivia Wilson",
"count":1}]}}}
====================================
I know for _txt field, its fieldType is "text_general" and class is
"solr.TextField"
for _txt_sort field, its fieldType is "text_gen_sort" and class is
"solr.SortableTextField"
It seems SortableTextField will influence Nested Facets but I could not
find any related document.
Is it a bug or SortableTextField is not acceptable in Nested Facets?
Many thanks in advance.
Kind regards,
Zhiqing