I need to 'rank' the documents in a solr index based on some field values and the query. Is this possible using function queries?
Two example to illustrate what I am trying to achieve: The index contains two fields min_rooms and max_rooms, both integers, both optional. If I query the index for a value (rooms) I would like the documents that place this value between min and max to be ranked higher than those that don't. The smaller the difference between min and max is, the more exact a match the document is and the higher the document will be ranked. If either min or max or both are not specified then the document gets a 'negative rank'. The index contains a float field. If, and only if, the query contains a search for this field (field:1 or field:on), then the value of the field affects the ranking of the document. (1, on, yes, etc can be solved with synonyms) Lastly, once this 'custom ranking works), how do I switch off solr's built in ranking calculations?