: I tried to simplify the problem, but the point is that I could have : really: complex requirements. For instance, "if in the first 5 results : none are older than one year, use sort by X, otherwise sort by Y".
First 5 in what order? X? Y or something else? : So, the question is, is there a way to make Solr recognize complex : situations and apply different sorting criterion. your question may seem simple to you, but unless you codify all the examples of what you consider a "complex situation" and how you expect those to be specified at run time, it's pretty much imposisble to give you an answer as to what the best way to achieve your goal is. the simplest answer based on the information available: if you can express your requirements in java, and put them in a custom Search Component, then Solr can do it. -Hoss