Just to complete my prev use case, in case no direct way is possible in SOLR to sort on a field in a different core, is there a way to embed the tagValue of a product dynamically into the results (the storeid will be passed at query time. So query the product_tags core for that product+storeid and get the tagValue and embed it into the product results probably in the "process" method of a custom component ... in the first place I believe we can add a value like that to each result doc). But then how can we sort on this value as I am now working on the results which came out after any initial sort was applied and can we re-sort at this very late stage using some java sorting in the custom component.
Thanks! Mark. On Wed, Jun 1, 2016 at 6:44 AM, Mark Robinson <mark123lea...@gmail.com> wrote: > Thanks much Eric and Hoss! > > Let me try to detail. > We have our "product" core with a couple of million docs. > We have a couple of thousand outlets where the products get sold. > Each product can have a different *tagValue* in each outlet. > Our "product_tag" core (around 2M times 2000 records), captures tag info > of each product in each outlet. It has some additional info also (a couple > of more fields in addition to *tagValue*), pertaining to each > product-outlet combination and there can be NRT *tag* updates for this > core (the *tagValue* of each product in each outlet can change and is > updated in real time). So we moved the volatile portion of product out to a > separate core which has approx 2M times 2000 records and only 4 or 5 fields > per doc. > > A recent requirement is that we want our product results to be bumped up > or down if it has a particular *tagValue*... for example products with > tagValue=X should be at the top. Currently only one tag*Value* considered > to decide results order. > A future requirement could be products with *tagValue=*X bumped up > followed by products with *tagValue=*Y. > > ie "product" results need to be ordered based on a field(s) in the > "product_tag" core (a different core). > > Is there ANY way to achieve this scenario. > > Thanks! > > Mark. > > > > > > > > On Tue, May 31, 2016 at 8:13 PM, Chris Hostetter <hossman_luc...@fucit.org > > wrote: > >> >> : When a query comes in, I want to populate value for this field in the >> : results based on some values passed in the query. >> : So what needs to be accommodated in the result depends on a parameter in >> : the query and I would like to sort the final results on this field also, >> : which is dynamically populated. >> >> populated how? ... what exactly do you want to provide at query time, and >> how exactly do you want it to affect your query results / sorting? >> >> The details of what you *think* you mean matter, because based on the >> information you've provided we have no way of guessing what your goal >> is -- and if we can't guess what you mean, then there's no way to imagein >> Solr can figure it out ... software doesn't have an imagination. >> >> We need to know what your documents are going to look like at index >> time (with *real* details, and specific example docs) and what your >> queries are going to look like (again: with *real* details on the "some >> values passed in the query") and a detailed explanation of how what >> results you want to see and why -- describe in words how the final sorting >> of the docs you should have already described to use would be determined >> acording to the info pased in at query time which you should have also >> already described to us. >> >> >> In general i think i smell and XY Problem... >> >> https://people.apache.org/~hossman/#xyproblem >> XY Problem >> >> Your question appears to be an "XY Problem" ... that is: you are dealing >> with "X", you are assuming "Y" will help you, and you are asking about "Y" >> without giving more details about the "X" so that we can understand the >> full issue. Perhaps the best solution doesn't involve "Y" at all? >> See Also: http://www.perlmonks.org/index.pl?node_id=542341 >> >> >> -Hoss >> http://www.lucidworks.com/ >> > >