A couple of things come to mind: 1> what happens if you remove the sort clauses? Because I suspect they're irrelevant and your duplicate issue is something different. 2> SOLR admin should let you determine this. 3> Please show us the configurations that make you sure that the documents are unique (I'm assuming you've defined <uniqueKey> in your schema, but please show us. And show us the field TYPE definition). 4> Assuming the uniqueKey is defined, did you perhaps define it after you'd indexed some documents? SOLR doesn't apply uniqueness retroactively. 5> Your secondary sort looks like it's on a tokenized field (again guessing, you haven't provided your schema definitions). It should not be. NOTE: this is different than multivalued! Again, I doubt this has anything to do with your duplcate issue, but it'll make your sorting "interesting".
Again, I think the sorting is unrelated to your underlying duplication issue, so until you're sure your index is in the state you think it's in, I'd ignore sorting.. Best Erick On Mon, Sep 13, 2010 at 5:56 AM, Stanislaw <solrgeschic...@googlemail.com>wrote: > Hi Dennis, > thanks for reply. > Please explain me what filter do you mean. > > I'm searching only on one field with names: > query.setQuery(suchstring); > > then I'm adding two sortings on another fields: > query.addSortField("type", SolrQuery.ORDER.asc); > query.addSortField("sortName", SolrQuery.ORDER.asc); > > the results should be sorted in first queue by 'type' (only one letter 'A' > or 'B') > and then they should be sorted by names > > how I can define hier 'OR' or 'AND' relations? > > Best regards, > Stanislaw > > > 2010/9/13 Dennis Gearon <gear...@sbcglobal.net> > > > My guess is two things are happening: > > 1/ Your combination of filters is in parallel,or an OR expression. This > I > > think for sure .... maybe, seen next. > > 2/ To get 3 duplicate results, your custom filter AND the OR expression > > above have to be working togther, or it's possible that your customer > filter > > is the WHOLE problem, supplying the duplicates and the triplicates. > > > > A first guess .... nothing more :-) > > Dennis Gearon > > > > Signature Warning > > ---------------- > > EARTH has a Right To Life, > > otherwise we all die. > > > > Read 'Hot, Flat, and Crowded' > > Laugh at http://www.yert.com/film.php > > > > > > --- On Mon, 9/13/10, Stanislaw <solrgeschic...@googlemail.com> wrote: > > > > > From: Stanislaw <solrgeschic...@googlemail.com> > > > Subject: Multiple sorting on text fields > > > To: solr-user@lucene.apache.org > > > Date: Monday, September 13, 2010, 12:12 AM > > > Hi all! > > > > > > i found some strange behavior of solr. If I do sorting by 2 > > > text fields in > > > chain, I do receive some results doubled. > > > The both text fields are not multivalued, one of them is > > > string, the other > > > custom type based on text field and keyword analyzer. > > > > > > I do this: > > > > > > * CommonsHttpSolrServer server > > > = > > > SolrServer.getInstance().getServer(); > > > SolrQuery query = new > > > SolrQuery(); > > > query.setQuery(suchstring); > > > query.addSortField("type", > > > SolrQuery.ORDER.asc); > > > //String field- it's only one letter > > > query.addSortField("sortName", > > > SolrQuery.ORDER.asc); //text > > > field, not tokenized > > > > > > QueryResponse rsp = new > > > QueryResponse(); > > > rsp = server.query(query);* > > > > > > after that I extract results as a list Entity objects, the > > > most of them are > > > unique, but some of them are doubled and even tripled in > > > this list. > > > (Each object has a unique id and there is only one time in > > > index) > > > If I'm sorting only by one text field, I'm receiving > > > "normal" results w/o > > > problems. > > > Where could I do a mistake, or is it a bug? > > > > > > Best regards, > > > Stanislaw > > > > > >