Building a tag cloud with solr

前端 未结 3 1779
滥情空心
滥情空心 2021-02-06 10:47

Dear stackoverflow community :

Given some text, I wish to get the TOP 50 most frequent words in the text, and create a tag cloud out of it, and thus show the gist of wha

3条回答
  •  别跟我提以往
    2021-02-06 11:09

    If a Lucene document is a comment, you could use faceting to do so. For example, the following request http://solr:port/solr/select?q={!lucene}uniqueKey:(MA147LL/A OR 3007WFP)&facet=true&facet.field=includes&facet.minCount=1&facet.limit=50 would help you build a tag cloud for comments MA147LL/A and 3007WFP.

    However, this approach would :

    • make Solr instantiate an UnInvertedField instance for the includes field, which required memory,
    • count the number of documents which match a term instead of the total number of occurrences of this term.

提交回复
热议问题