Hi Grant,
The problem is that even if we're only displaying 16 products at a time,
we're potentially sorting over a collection of thousands. This means
it's pretty essential for the ordering from solr to be correct.
- Andy
Grant Ingersoll wrote:
WARNING: Low level Solr hacking and brainstorming:
I _wonder_ if you could plug in a FieldSelector that was aware of the
date and then made the appropriate decision to return the correct
price field. (On a side note, I'd love to see Solr support generic
FieldSelector plugin capability)
Alternatively, you could right a simple "post-processing"
SearchComponent that loops over the return doc list (not the full doc
set) and added a field to each document that contained the "official
price". Assuming you are only returning 10 or so results, I would
think this would still perform pretty well.
-Grant
On May 6, 2009, at 4:32 AM, Andrew Ingram wrote:
Hi everyone,
I'm working on the search schema for ecommerce products and I'm having
an issue with the prices.
Basically, a product has two price values and a date, the product
effectively has one price before the date and the other one after.
This poses no problem for the site itself since I can use conditional
logic, but I have no idea how to approach this with regards to solr
queries.
The price of a product is used for both faceting and sorting and
should use whichever price is active at the time of the query. Is
there any way to do define a field whose value is a simple algorithm
operating on the value of other fields?
I'm quite happy to use a custom field type if necessary, though I'm
not sure if what I want is even possible and I don't really know where
to begin.
Any help would be appreciated
Regards,
Andrew Ingram
--------------------------
Grant Ingersoll
http://www.lucidimagination.com/
Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)
using Solr/Lucene:
http://www.lucidimagination.com/search