britske wrote >> Ah; ok. But still, my first suggestion is still what I think you could >> do >> except that the algorithm is simpler -- return the first matching 'y' in >> the >> document where the point matches the query. Alternatively, if you're >> confident the number of matching documents (hotels) is going to be >> small-ish, say less than a couple hundred, then you could simply sort it >> client-side. You'd have to get back all the values, or maybe write a >> DocTransformer to find the specific one. >> >> ~ David >> >> > Writing something similar to ShapeFieldCacheDistanceValueSource, being a > valueSource, would enable me to expose it by name to the frontend? > What I'm saying is: let's say I want to call this implementation > 'pricesort' and chain it with other sorts, like: 'sort=pricesort asc, > popularity desc, name asc'. Or use it by name in a functionquery. That > would be possible right? > > Geert-Jan
It wouldn't quite work this way. The Solr adapters to Lucene spatial can't simply have a field expose a ValueSource because it needs to be configured with the search parameters (e.g. the query center point). See: http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4#Sorting_and_Relevancy and in particular the sort=query(...) part. The wiki shows 2 ways, this way and the other way when q= the spatial query then you simply do score sorting. ~ David ----- Author: http://www.packtpub.com/apache-solr-3-enterprise-search-server/book -- View this message in context: http://lucene.472066.n3.nabble.com/modeling-prices-based-on-daterange-using-multipoints-tp4026011p4026456.html Sent from the Solr - User mailing list archive at Nabble.com.