Since I just tried to compare the search results (1.9) with the postgres FTS, I decided that I should share my results, since they are somewhat closer than @gustavodiazjaimes quotes.
My main concern for postgres was that it did not have facets, but it is trivial to build itself, here is my example (in django):
results = YourModel.objects.filter(vector_search=query) facets = (results .values('book') .annotate(total=Count('book')) .order_by('book'))
I am using postgres 9.6 and elastic-search 1.9 (via haystack on django). Here is a comparison between elasticsearch and postgres on 16 different types of queries.
es_times pg_times es_times_faceted pg_times_faceted 0 0.065972 0.000543 0.015538 0.037876 1 0.000292 0.000233 0.005865 0.007130 2 0.000257 0.000229 0.005203 0.002168 3 0.000247 0.000161 0.003052 0.001299 4 0.000276 0.000150 0.002647 0.001167 5 0.000245 0.000151 0.005098 0.001512 6 0.000251 0.000155 0.005317 0.002550 7 0.000331 0.000163 0.005635 0.002202 8 0.000268 0.000168 0.006469 0.002408 9 0.000290 0.000236 0.006167 0.002398 10 0.000364 0.000224 0.005755 0.001846 11 0.000264 0.000182 0.005153 0.001667 12 0.000287 0.000153 0.010218 0.001769 13 0.000264 0.000231 0.005309 0.001586 14 0.000257 0.000195 0.004813 0.001562 15 0.000248 0.000174 0.032146 0.002246 count mean std min 25% 50% 75% max es_times 16.0 0.004382 0.016424 0.000245 0.000255 0.000266 0.000291 0.065972 pg_times 16.0 0.000209 0.000095 0.000150 0.000160 0.000178 0.000229 0.000543 es_times_faceted 16.0 0.007774 0.007150 0.002647 0.005139 0.005476 0.006242 0.032146 pg_times_faceted 16.0 0.004462 0.009015 0.001167 0.001580 0.002007 0.002400 0.037876
To get postgres for these speeds for faceted searches, I had to use the GIN index in the field with SearchVectorField, which is specific to Django, but I am sure that other frameworks have a similar vector type.
Another consideration is that pg 9.6 now supports a matching phrase, which is huge.
My damage is that postgres will be preferred for most cases, as it suggests:
- simpler stack
- no dependency search is required for backend api wrapper s (thinking-sphinx, django-sphinx, haystack, etc.). This can be drag and drop, as they may not support the functions that your back-end performs (e.g. haystack torch / aggregates).
- has similar performance and features (for my needs)
yekta 04 Oct '16 at 14:50 2016-10-04 14:50
source share