Re: Simulate facet.exists for json query facets

2020-10-30 Thread Michael Gibney
>If all of those facet queries are _known_ to be a performance hit, you might be able to do something custom.That would require custom code though and I wouldn’t go there unless you can demonstrate need. Yeah ... indeed if those facet queries are relatively static (and thus cacheable ... even if

Re: Simulate facet.exists for json query facets

2020-10-30 Thread Erick Erickson
I don’t think there’s anything to do what you’re asking OOB. If all of those facet queries are _known_ to be a performance hit, you might be able to do something custom.That would require custom code though and I wouldn’t go there unless you can demonstrate need. If you issue a debug=timing

Re: Simulate facet.exists for json query facets

2020-10-30 Thread Michael Gibney
Michael, sorry for the confusion; I was positing a *hypothetical* "exists()" function that doesn't currently exist, that *is* an aggregate function, and the *does* stop early. I didn't account for the fact that there's already an "exists()" function *query* that behaves very differently. So yes,

Re: Simulate facet.exists for json query facets

2020-10-30 Thread michael dürr
@Erick Sorry! I chose a simple example as I wanted to reduce complexity. In detail: * We have distinct contents like tours, offers, events, etc which themselves may be categorized: A tour may be a hiking tour, a mountaineering tour, ... * We have hundreds of customers that want to facet their

Re: Simulate facet.exists for json query facets

2020-10-28 Thread Michael Gibney
Separately, and in parallel to Erick's question: indeed I'm not aware of any way to do this currently, but I *can* imagine cases where this would be useful. I have a sense this could be cleanly implemented as a stat facet function

Re: Simulate facet.exists for json query facets

2020-10-28 Thread Erick Erickson
This really sounds like an XY problem. The whole point of facets is to count the number of documents that have a value in some number of buckets. So trying to stop your facet query as soon as it matches a hit for the first time seems like an odd thing to do. So what’s the “X”? In other words,

Simulate facet.exists for json query facets

2020-10-28 Thread michael dürr
Hi, I use json facets of type 'query'. As these queries are pretty slow and I'm only interested in whether there is a match or not, I'd like to restrict the query execution similar to the standard facetting (like with the facet.exists parameter). My simplified query looks something like this (in