开发者

Solr powered Tag Cloud

开发者 https://www.devze.com 2023-02-27 22:19 出处:网络
I seem to be stuck behind the logic of a Solr faceting-powered tag cloud. First of all, I\'m using OpenNLP to parse my docs and obtain relevant words out of it, so every single document gets split int

I seem to be stuck behind the logic of a Solr faceting-powered tag cloud. First of all, I'm using OpenNLP to parse my docs and obtain relevant words out of it, so every single document gets split into n number of words. And here's basically what my Solr response looks like:

<docID>
<title>My Doc Title</title>
<content>My Doc Title</content>
<date_published>My Doc Title</date_published>
</docID>

I believe there must be a way to integrate the words in here. I first thought of something like this:

<docID>
<title>My Doc Title</title>
<content>My Doc Title</content>
<date_published>My Doc Title</date_published>
<words>word</words>
<words1>word1</words1>
<words2>word2</words2>
<words3>word3</words3>
<wordsN>word开发者_Python百科N</wordsN>
</docID>

But the faceting wouldn't be possible, as i have no idea how many words fields i would get per docID, then the faceting would have to be done across fields (which i;m not even sure it;s possible). I am trying to look into possible answers but I seem to be stuck... at the end, i need to make a faceting of n words that would get each single doc I have in my index. Thoughts would highly be appreciated.


I would suggest using a single words field that is multivalued and stores the list of words per document.

having unbound number of word\d+ fields will complicate things.

if you use a single words multivalued field you can get all the words along with their frequencies which should be enough for creating the tag cloud.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号