lucene中facet實現統計分析的思路——本質上和word count計數無異

來源:互聯網
上載者:User

標籤:for   trie   from   over   log   ack   統計   堆排   org   

http://stackoverflow.com/questions/185697/the-most-efficient-way-to-find-top-k-frequent-words-in-a-big-word-sequence

http://www.geeksforgeeks.org/find-the-k-most-frequent-words-from-a-file/

http://cs.stackexchange.com/questions/26427/word-frequency-with-ordering-in-on-complexity

思路大致如下:

(1)hash表統計單詞出現次數,然後尋找top k出現的,其中top k可以使用n*log(k)的堆思路,或者快排思路,或者是桶排序思路(以前fbt裡實現即時的積分排序);

(2)使用trie來統計單詞出現次數,然後便利trie,利用堆排序思路求top k;

(3)使用桶排序,尤其是當你知道最大出現次數時候,類似以前做fbt實現的即時積分排序,然後從大到小取出top k;

(4)用map reduce。

lucene中facet實現統計分析的思路——本質上和word count計數無異

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.