Re: Using function queries for faceting

2017-04-08 Thread Georg Sorst
Hi Mikhail, thanks, JSON facet domains may actually be the key! Something like (when a user from group1 is searching): 1. Facet on price_group1 2. Facet on price for all results that do not have price_group1 field using JSON facet domain 3. Sum up the facet counts Best, Georg Mikhail Khludnev

Re: Using function queries for faceting

2017-04-04 Thread Mikhail Khludnev
Exclude users' products, calculate default price facet, then facet only user's products (in a main query) and sum facet counts. It's probably can be done with switching domains in json facets. On Tue, Apr 4, 2017 at 5:43 PM, Georg Sorst wrote: > Hi Mikhail, > > copying the default field was my f

Re: Using function queries for faceting

2017-04-04 Thread Georg Sorst
Hi Mikhail, copying the default field was my first attempt as well - however, the system in total has over 50.000 users which may have an individual price on every product (even though they usually don't). Still, with the copying approach this results in every document having 50.000 price fields.

Re: Using function queries for faceting

2017-04-04 Thread Mikhail Khludnev
Hello Georg, You can probably use {!frange} and and a few facet.query enumerating price ranges, but probably it's easier to just copy default price across all empty price groups in index time. On Tue, Apr 4, 2017 at 1:14 PM, Georg Sorst wrote: > Hi list! > > My documents are eCommerce items. T

Using function queries for faceting

2017-04-04 Thread Georg Sorst
Hi list! My documents are eCommerce items. They may have a special price for a certain group of users, but not for other groups of users; in that case the default price should be used. So the documents look like something like this: item: id: 1 price_default: 11.5 price_group1: 11.2 item: