Facets in HS 0.08

24 views
Skip to first unread message

Achim Domma

unread,
Nov 25, 2014, 12:37:19 PM11/25/14
to helio...@googlegroups.com
Hi,

I'm have problems running our software with HS 0.08. The problem is about facets and the current status is not clear to me. We use the "old" way of calculating statistics in HS. Something like this:

f.my_field_name.facet.stat=count:count()

In that case I get the following error:

Unknown facet.stat count:count()

It is not clear to me, whether this is still supposed to work or if we have to change it to use the new json API. 

kind regards,
Achim

Yonik Seeley

unread,
Nov 25, 2014, 12:42:13 PM11/25/14
to helio...@googlegroups.com
The next version (0.09) has the old API removed (supporting two
different APIs isn't a good idea over the long term).
I'm not sure why you're getting an error, but you would be best off to
just bite the bullet and switch to the new API. I can help convert
the facet commands if the syntax isn't clear.

I'll be releasing 0.09 shortly with distributed support, and also a
bugfix for nested facets with the new API.

-Yonik
http://heliosearch.org - native code faceting, facet functions,
sub-facets, off-heap data

Achim Domma

unread,
Nov 25, 2014, 2:04:43 PM11/25/14
to helio...@googlegroups.com, yo...@heliosearch.com
Just to make sure I understood you right: It would be a very good idea to go for the new API, but in theory our code - which works fine with 0.07 - should still work with 0.08?

Achim

Yonik Seeley

unread,
Nov 25, 2014, 2:09:40 PM11/25/14
to helio...@googlegroups.com
On Tue, Nov 25, 2014 at 2:04 PM, Achim Domma <ac...@uberresearch.com> wrote:
> Just to make sure I understood you right: It would be a very good idea to go
> for the new API, but in theory our code - which works fine with 0.07 -
> should still work with 0.08?

Correct. But if it no longer works, there's probably something I
broke in the old API when I introduced the new API.

-Yonik
> --
> You received this message because you are subscribed to the Google Groups
> "heliosearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to heliosearch...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Achim Domma

unread,
Nov 26, 2014, 11:46:07 AM11/26/14
to helio...@googlegroups.com
On Tuesday, November 25, 2014 8:09:40 PM UTC+1, yonik wrote:
 
Correct.  But if it no longer works, there's probably something I
broke in the old API when I introduced the new API.


I think I found the change from 0.07 to 0.08: The count function has gone!?

We will go for the new API as soon as possible, but I would really appreciate if you could help to find a short term workaround. Here is my more detailed situation: For f.some_field.facet.stat I try to calculate the following aggregations:

count:count()
score:sum(query($qq))
funding:sum(some_amount_in_usd)

This code worked before, but not with 0.08 anymore. If I remove the count, everything is fine again. Checking the current documentation, I don't see count() anymore in the aggregation functions.

I played around with different queries and in some cases I get back the count automatically, even without specifying count:count(). But not always and it looks like it has something to do with the sorting I specify. If I could force HS to always return the count, everything would be fine. Do you have any idea why I sometimes get the count and sometimes not? And how to enforce the count? That would solve all my problems.

Achim

Yonik Seeley

unread,
Nov 26, 2014, 11:57:12 AM11/26/14
to helio...@googlegroups.com
On Wed, Nov 26, 2014 at 11:46 AM, Achim Domma <ac...@uberresearch.com> wrote:
> I think I found the change from 0.07 to 0.08: The count function has gone!?
>
> We will go for the new API as soon as possible, but I would really
> appreciate if you could help to find a short term workaround. Here is my
> more detailed situation: For f.some_field.facet.stat I try to calculate the
> following aggregations:
>
> count:count()
> score:sum(query($qq))
> funding:sum(some_amount_in_usd)
>
> This code worked before, but not with 0.08 anymore. If I remove the count,
> everything is fine again. Checking the current documentation, I don't see
> count() anymore in the aggregation functions.

In the new API, document count is always reported, making it redundant to ask.

> I played around with different queries and in some cases I get back the
> count automatically, even without specifying count:count(). But not always
> and it looks like it has something to do with the sorting I specify. If I
> could force HS to always return the count, everything would be fine. Do you
> have any idea why I sometimes get the count and sometimes not? And how to
> enforce the count? That would solve all my problems.

Yes, in the old API I think you get back count only if you ask for it,
or are sorting by it (and the default sort is by count descending).

I could probably make a patch to 0.08 to restore count() within the
next couple of days (tomorrow is thanksgiving here in the US
though...)

-Yonik

Achim Domma

unread,
Dec 3, 2014, 3:15:24 PM12/3/14
to helio...@googlegroups.com, yo...@heliosearch.com
On Wednesday, November 26, 2014 5:57:12 PM UTC+1, Yonik Seeley wrote:
 
I could probably make a patch to 0.08 to restore count() within the
next couple of days (tomorrow is thanksgiving here in the US
though...)


Would be great and help us a lot with the transition, if you could provide this patch!

Achim 

Yonik Seeley

unread,
Dec 5, 2014, 4:32:42 PM12/5/14
to helio...@googlegroups.com
OK, I coded up a converter... try Heliosearch v0.09 and add
"facet.version=2" to your request.

-Yonik
Reply all
Reply to author
Forward
0 new messages