1stenjoydmoment
1stenjoydmoment

Reputation: 249

Getting unexpected output in SOLR facet.pivot grouping

I am trying to group the fields in Solr using facet.pivot option. Its working as expected when there is no special character in actual data. In case if any special characters are in actual data then the output is getting split into many.

below is the url I am trying to group using facet.pivot.here escalation_dl is the email address which has some special characters

/select?facet=true&facet.limit=-1&facet.pivot=job_name,escalation_dl&q=*:*

Actual Output:

"field":"job_name",
          "value":"test_job1",
          "count":1,
          "pivot":[{
              "field":"escalation_dl",
              "value":"test",
              "count":1},
            {
              "field":"escalation_dl",
              "value":"gmail.com",
              "count":1}]}

Expected Output

"field":"job_name",
          "value":"test_job1",
          "count":1,
          "pivot":[{
              "field":"escalation_dl",
              "value":"[email protected]",
              "count":1}]}

Upvotes: 1

Views: 66

Answers (1)

MatsLindh
MatsLindh

Reputation: 52832

This is because the field you're faceting on has a field type with a Tokenizer and filters attached (such as the default text_general field). Use a string field for any field you want to facet on, as that will keep the values intact as you expect.

Upvotes: 2

Related Questions