You need to be clear about what to do when. The [subquery], is completely separate from _finding_ the top N docs. Your last question is about finding the top N.
There are really two choices that spring to mind, depending on where you keep your data about the user. Solr can't magically know that user X wants a specific price range. One choice would be to have the app layer contact wherever the data is kept and add fq clauses. Another is to keep the data in Solr somewhere and write a search component that tacks this kind of clause on the incoming query. Best, Erick On Wed, Feb 1, 2017 at 7:39 AM, Ugo Matrangolo <ugo.matrang...@gmail.com> wrote: > Hi, > > tx for the speedy response. > > What if I need to filter on the result matches ?? > > Example: I have a price I need to personalize per user/request and need > then to apply filter ranges on this personalized price (show only stuff in > the 10$ - 99$ range). > > WDYT ? > > Best > Ugo > > On Wed, Feb 1, 2017 at 3:34 PM, Erick Erickson <erickerick...@gmail.com> > wrote: > >> If the data is from another Solr instance, consider the [subquery] >> Document Transformer here: >> https://cwiki.apache.org/confluence/display/solr/ >> Transforming+Result+Documents#TransformingResultDocuments-[subquery] >> >> More broadly, you can write a custom DocTransformer plugin do insert >> anything you want in the output documents. >> >> NOTE: DocTransformer only works on the top N docs being returned, >> which is what I think you want. IOW, if rows=10 it only "sees" 10 >> documents even if numFound is millions. >> >> Best, >> Erick >> >> >> >> On Wed, Feb 1, 2017 at 7:04 AM, Ugo Matrangolo <ugo.matrang...@gmail.com> >> wrote: >> > Hi, >> > >> > I'm trying to write a SearchComponent that personalizes on the fly a >> field >> > on all the docs resulting from the initial search query. >> > >> > What I would like to do is to write a SearchComponent that intercepts the >> > documents belonging to the result sets of a search query and upsert one >> or >> > more of their field values with infos retrieved from external svc/logic. >> > >> > I can't pre-compute all of these values because they are highly dependant >> > on the user/context. >> > >> > I was wondering if someone here already did something like this and, more >> > broadly, has some experience in personalizing a search response in the >> Solr >> > guts. >> > >> > Best >> > Ugo >>