how to grouping result by domain in solr?

Go To StackoverFlow.com

0

I have crawled many sites with nutch. I'm using Solr 3.4 to browse the results but I want to group the results by their domain. For example, if I search for "tabnak", the first result only contains "http://tabnak.ir" and does not show the other results from that domain (like google does).

I want to ignore results such as:

http://tabnak.ir/en/news/1020/title
http://tabnak.ir/fa/allnews
...

How can I create query for solr with group, group.field and ...?

Thanks

2012-04-04 05:02
by hadi
what do you mean - hadi 2012-04-04 20:45
As far as i know, SOLR doesn't know about domains. It's just a string. besides, i think the question is not quite well explained, please polish it a bit mor - Fermin Silva 2012-04-09 23:36


0

You should create a separate indexed field (for example named 'domain' in this case) and should make sure you separate the domain from the url when SOLR indexes your data.

Then you have to apply grouping of field collapsing to your search results. See: http://wiki.apache.org/solr/FieldCollapsing

2016-03-08 14:41
by elachell
Ads