You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by John Blythe <jo...@curvolabs.com> on 2017/02/07 21:56:41 UTC

complex query is stumping me

hi all.

i'm attempting to grab up a swath of data based on some parameters that i'm
finding difficult to express in a query:

   - i'd like to get all the data from a purchasing group (simple fq on
   their ids)
   - where items are grouped on one (or one of a few) unique identifiers
   (grouping? complex faceting?)
   - use either function fields or stats data to perform a calculation used
   to order them.
      - the specific data i'm looking for is the disparity in highest and
      lowest pricing in any group members per item, ordered by highest
disparity
      to lowest
   - limit to 100 rows so i can show them their biggest offenders

those two middle points are the rub, of course. i'm hoping to use solr's
capabilities to cut out a middleman of server side processing to loop
through all the data of a given purchasing group, get results specific to
each purchase, and then determine what's what. i may be asking too much
from solr, though.

i certainly don't want a query for an answer here, not looking for a
handout, but would love to walk through towards a solution if it is indeed
possible to satisfy the above reqs.

thanks for any thoughts!

-- 
*John Blythe*

Re: complex query is stumping me

Posted by "alessandro.benedetti" <a....@sease.io>.
Hi John,
let me try to recap :
Your Solr Document is an Item with a price as one of the fields, a
purchaseGroupId a groupId.
You filter by purchaseGroupId and then you group by ( or collapse by the
groupId).
At this point how do you want to assign the score ?
For each document in a groupId you want to calculate the score as :
Max price - min price per ItemId ?
How do you want to sort the groups then ?
A simple score desc ?

So you have a :
purchase_group_id
group_id
item_id
?


Cheers





-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
View this message in context: http://lucene.472066.n3.nabble.com/complex-query-is-stumping-me-tp4319237p4319271.html
Sent from the Solr - User mailing list archive at Nabble.com.