Hacker News new | past | comments | ask | show | jobs | submit | more akane's comments login

That's exactly why we open-sourced Searchkick :)


We're indexing around 100k documents. What line are you referring to, and what's bad about it?


Awesome, added this to the todo list.


I would suggest denormalizing only after you find a performance bottleneck. As they say, "premature optimization is the root of all evil".


Good suggestion!


Just a pull request away :)


For those concerned about a SQL dependency, it might be useful to create projects in different languages that package these functions. These methods were extracted from https://github.com/ankane/groupdate, which you can use for Ruby + ActiveRecord

(edit: spelling)


Thanks for the feedback. Working correctly with time zones in the database can be tricky.

DATE_TRUNC('day', $1 AT TIME ZONE $2) AT TIME ZONE $2;

or

CONVERT_TZ(DATE_FORMAT(CONVERT_TZ(ts, '+00:00', time_zone), '%Y-%m-%d 00:00:00'), time_zone, '+00:00');

are not very intuitive (or aren't to me at least).


Simply use and store everything in UTC. If you ever need to do grouping by time in any other timezone, it would be trivial to do the conversion.

DAYOFYEAR( CONVERT_TZ(my_datetime_field,'+00:00', '+02:00') )

Seems very intuitive to me.


curl | sh is a very transparent installer. Here's the source. https://raw.github.com/ankane/groupdate.sql/master/mysql.sql

Also, you don't have to use the root user - I'll make that more clear. Thanks for the feedback!


did you access that url with curl to make sure it does no user agent sniffing?

how do you know the script is the same on subsequent requests?


It's an https request to GitHub, which has about a million more subtle ways to own your machine if they really wanted to.

Figuring out how to solve the TOCTOU problem for a small script in a source control repo is should not be difficult for anyone actually qualified to tell if a script is evil or not by looking at it.


You can always `curl`, then `cat | sh` if you don't trust me :)


Minimum customization right now, but I'm open to add more options if specific ones are in high demand.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: