1

I am trying to grasp the ins and outs of Elasticsearch and others of its type. The problem for me has been all the new vocabulary that does not obviously track to systems I already know and understand, hence this post.

It looks like a faceted search is directly analogous to doing a field search on Postgres or any other RDBMS, but I'm uncertain if that's right, since Elasticsearch, I'm told, is 'sort of' a NoSQL. Can someone here either clarify for me directly, or point me to some good, non jargony explanations?

Also, what is the analogy to searching on a foreign key relation? Or is the fk just another "facet"?

Thanks.

Malik A. Rumi
  • 1,855
  • 4
  • 25
  • 36

2 Answers2

0

Faceted search is aggregatons similar to sql groupby with aggr.functions. Query by field is completely different matter. In most cases there's nothing like foreign key in ES

xeye
  • 1,250
  • 10
  • 15
0

I found the answers. 1. Yes, something closely analagous to a field search on postgres (PG) can be done on ES, and in fact is done all the time. In fact, they are called fields on ES, even though there is not a one to one correspondence between what you would do on PG and what you do on ES. A corollary to that is that you can, and probably should, use both, for different purposes, since ES is not transactional. Although this guy is teaching Ruby (I use Python) his video and script make syncing from PG to ES ridiculously easy: https://www.youtube.com/watch?v=uMctvIIgBGY&index=3&list=PLjQo0sojbbxWcy_byqkbe7j3boVTQurf9 (Episode 2 Mapping and Syncing). Finally, on this point, "facets" are being deprecated by ES. Instead, the new term of art is "aggs", aka "aggregations", in this case, specifically, "bucket" aggregations. See Episode 7 from the Ruby guy mentioned above, and https://www.youtube.com/watch?v=H4V9ukR5fYQ Elasticsearch - Aggregations.

  1. ES does in fact support relations that look very much like foreign keys: has_a_child and has_a_parent. What's more, you can use nesting to make your fields / attributes / whatever you want to call them "relate" to what had been fk's on PG when you sync. See the official docs as well as the aforementioned videos: https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html.
Malik A. Rumi
  • 1,855
  • 4
  • 25
  • 36