Konstantin Perikov created SOLR-13156:

             Summary: Limiting field facet with certain terms via {!terms} not 
taking into account sorting
                 Key: SOLR-13156
                 URL: https://issues.apache.org/jira/browse/SOLR-13156
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: Facet Module
            Reporter: Konstantin Perikov

When I'm doing limiting facet keys with \{!terms} it doesn't take into account 

First query not limiting the facet keys:


Response as expected:

{{"facet_counts":\{ "facet_queries":{}, "facet_fields":\{ "title":[ "book2",3, 
"book1",2, "book3",1]}, "facet_ranges":{}, "facet_intervals":{}, 


When doing it with limiting:


I'm getting the exact order of how I list terms:

{{"facet_counts":\{ "facet_queries":{}, "facet_fields":\{ "title":[ "Book3",1, 
"Book2",3, "Book1",2]}, "facet_ranges":{}, "facet_intervals":{}, 

I've looked at the code, and it's clearly an issue there:




{{for (String term : terms) {}}
{{    int count = searcher.numDocs(ft.getFieldQuery(null, sf, term), 
{{    res.add(term, count);}}


it's just basically iterating over terms and don't do any sorting at all. 



This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to