Have SolR limit number of hits per file
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.
精彩评论