You haven't answered _why_ this is a good idea. I'm having a hard time understanding what would be _useful_ about sorting this way. Just because the sum of scores in a group is greater than the sum of scores in another says _nothing_ about how relevant any of the docs in the group are relative to each other.
I mean group 1 could have 10M documents all with a score of .01 and group 2 could have 1 document with a score of 1,000 and group 1 would sort first. So unless you have some unusual use-case which you haven't yet articulated, this seems like a bad idea. Best, Erick On Mon, May 5, 2014 at 7:20 PM, Frankcis <finalxc...@gmail.com> wrote: > my scheme.xml: > <schema name="example core one" version="1.1"> > <types> > <fieldtype name="string" class="solr.StrField" sortMissingLast="true" > omitNorms="true"/> > <fieldType name="long" class="solr.TrieLongField" precisionStep="0" > positionIncrementGap="0"/> > <fieldType name="uuid" class="solr.UUIDField" indexed="true" /> > <fieldtype name="textComplex" class="solr.TextField" > positionIncrementGap="100" omitNorms="false" > autoGeneratePhraseQueries="false"> > <analyzer type="query"> > <tokenizer > class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" > mode="complex" dicPath="E:\solr-4.6.1\example\solr\dict"/> > <filter class="solr.StopFilterFactory" ignoreCase="true" > words="stopwords.txt"/> > <filter class="solr.SynonymFilterFactory" > synonyms="synonyms.txt" > ignoreCase="false" expand="true"/> > </analyzer> > <analyzer type="index"> > <tokenizer > class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" > mode="complex" dicPath="E:\solr-4.6.1\example\solr\dict"/> > <filter class="solr.StopFilterFactory" ignoreCase="true" > words="stopwords.txt"/> > <filter class="solr.SynonymFilterFactory" > synonyms="synonyms.txt" > ignoreCase="false" expand="true"/> > </analyzer> > </fieldtype> > </types> > > <fields> > <field name="id" type="uuid" > indexed="true" stored="true" > multiValued="false" required="true" /> > <field name="name" type="textComplex" indexed="true" > stored="true" multiValued="false" /> > <field name="type" type="string" indexed="true" stored="true" > multiValued="false" /> > <field name="price" type="long" indexed="true" > stored="true" /> > > <field name="_version_" type="long" indexed="true" stored="true"/> > </fields> > > <uniqueKey>id</uniqueKey> > > > <defaultSearchField>name</defaultSearchField> > > > <solrQueryParser defaultOperator="OR"/> > </schema> > > update docs: > "docs": [ > { > "name": "苹果4s", > "type": "手机", > "price": 2000, > "id": "4017e35a-6b19-45b6-b945-382340ca1eec", > "_version_": 1466799722505175000 > }, > { > "name": "苹果5", > "type": "手机", > "price": 5000, > "id": "4052d9f3-f6d9-458f-8bb0-477b17852f37", > "_version_": 1466799735745544200 > }, > { > "name": "三星", > "type": "手机", > "price": 3000, > "id": "468abce8-8bb9-4f51-9900-8d4d6abc02ac", > "_version_": 1466799747596550100 > }, > { > "name": "摩托罗拉i3", > "type": "电脑", > "price": 1000, > "id": "db66bb02-3d6a-4ab0-9133-2e6e38b3d4dd", > "_version_": 1466799757491961900 > }, > { > "name": "摩托罗拉i5", > "type": "电脑", > "price": 1500, > "id": "f211525f-bc3c-4ea7-aded-1c46a94ecd1c", > "_version_": 1466799766311534600 > } > ] > thank you , Erick, > i want to sort groups based on the sum of documents' scores within each > group, as you said, solr excels at getting the score of single documents, in > solr 4.6, the default sort of group each other depends on the maxScore of > all documents within each group, but the sum of documents' scores, though i > can get the sum of documents' scores by the client program, it's not good > idea, l know that the stats component of solr can statistics the long field, > so I had the idea to use statistic data for score field, but the score is > pse-udo field, the stats.field doesn't support it. In addition, as > scheme.xml displayed, i do group on the elements of a string field(type) > without using participle. > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Re-sort-groups-by-the-sum-of-the-scores-of-the-documents-within-each-group-tp4134715p4134830.html > Sent from the Solr - User mailing list archive at Nabble.com.