: Is it possible to assign a custom sorting value for : each of the values in the multivalued field? So that : the document gets sorted differently, depending on the : matched value in the multivalued field.
Sorting happens extremely independently from matching ... there is no mechanism available in the underlying Lucene code to allow the Sorting logic to know why a particular document is a match. : The other approach would be to store each : document/keyword pair as a separate document with the : sorting value as an explicit field. Is it possible to : filter the results on the Solr end (based on the : relevancy of the matched keyword), so that the same : original document doesn't appear in the result set : twice? can you elaborate a bit more on what exactly it is you are trying to achieve? ...i'm having a hard time understanding hte motivation for sorting on a keyword field where the sort order is on the keyword that matches .. for simple single word queries all document will sort identically, for multi-word queries you might as well just search on each word seperately and concatenate the result sets in order -- except in the case where a single document matches on more then one of your query terms, but you've already said you just want it to appear once ... but why would you want documents in this order in the first place? my first assumption would be thaty ou just want docs which match on very rare keyword to come first and you are only doing searches on this keyword field, then regualr sort by score should do what you want ... but you might wnat to omitNOrms and maybe change the coordFactor in your similarity. -Hoss