开发者

Have SolR limit number of hits per file

开发者 https://www.devze.com 2023-01-24 08:19 出处:网络
I have a SolR index where each record is a page from a file. So for every record we have the full text, the page number and the file ID.

I have a SolR index where each record is a page from a file. So for every record we have the full text, the page number and the file ID.

When we do a search, often a sing开发者_JAVA百科le file will overwhelm the results as it contains the search term repeatedly.

What I would like to do is to have the search query only return a maximum of two hits per document and then offer the user a "see more hits from this document" which would do another, more limited query. I.e. similar to how Google will only show you a handful of results from any given domain, with the option of seeing more from each.

Is there anyway to structure a SolR query to accomplish this?


Which solr version are you using? If it's 4.0 (i.e. nightly), then you can use collapsing on the filename field.

0

精彩评论

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