How does Solr sort by default when using filter query *:*?

后端 未结 2 564
-上瘾入骨i
-上瘾入骨i 2021-01-02 05:12

We currently have a page setup that has no filters/facet/queries applied. It is a listing of all content (using a pager). The filter query is something like *:*

相关标签:
2条回答
  • 2021-01-02 05:43

    The default search should be by score desc if the sort parameter is not specified. : will just select everything.

    Reference: http://wiki.apache.org/solr/CommonQueryParameters#q

    0 讨论(0)
  • 2021-01-02 05:44

    Querying for *:* is also called a MatchAllDocsQuery. According to the SO question How are results ordered in solr in a "match all docs" query it will return the docs in the same order as they were stored in the index.

    Be aware that if you update an existing document, it get's deleted and recreated. As such it would appear at the end of such a search afterwards.

    There are (at least) two threads in Lucene's Nabble I am aware of that are interesting on this topic

    • http://lucene.472066.n3.nabble.com/Result-order-when-score-is-the-same-td2816127.html
      • gets really interesting around here http://lucene.472066.n3.nabble.com/Result-order-when-score-is-the-same-tp2816127p2817766.html
    • http://lucene.472066.n3.nabble.com/Result-ordering-for-Wildcard-Prefix-queries-or-ConstantScoreQueries-td492687.html
    0 讨论(0)
提交回复
热议问题