Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search tool in Meteor JS

Im quite a newbie when it comes to DBs and search so please bear with me. Im trying to implement a search function in Meteor app. Ive checked through atmosphere and chanced upon these 4 options.

  1. Mattodem easy search
  2. Search Source
  3. Elastic search package on Atmosphere (heard this is dated)
  4. Elastic big data package on Atmosphere

My needs are for a simple search, able to handle larger data sets that may have data nesting. For example a task, may have comments or links etc. (Full text and more than regex query will be good)

I read that for easy search, even with some form of elastic or Mongodb application, seems to be application only for a single Mongo collection?For example what if I wanted to search across Dinosaurs = new Meteor.Collection('dinosaurs'); and Mammals = new Meteor.Collection('mammals');?

Appreciate any advice on the pros and cons on the 4 options above? 1 seems relative easy to implement but I,m not sure what it means by using elastic engine here. If I were to implement elastic, how do I go about doing it in Meteor? And would it differ from implementing a Elasticsearch HTTP API?

Similarly for Search Source, it supports Elastic too here. Honestly I have no clue on the differences.

like image 630
Thinkerer Avatar asked Apr 21 '15 16:04

Thinkerer


1 Answers

This github project demonstrates how to use Meteor with ElasticSearch (not Mongo) for search applications

https://github.com/hharnisc/meteor-elasticsearch-demo/tree/master/elasticsearch-demo/packages/elastic-collection

it basically links a field to a session variable which triggers search on elastic. results are stored in a mongo collection that is pushed to the client through the Meteor mechanics. These are much smaller than the dataset and therefore are quick to update.

As far as searching accross collections, this is a typical problem of database schema definition. If you need to do joins, a mongodb is not the best solution. and relational DB like any SQL DB would be better suited, However, you should be looking into 'denormalization' of your data to see if you can create a structure that will work well for your use case.

This article explains what this means pretty well:

http://blog.mongodb.org/post/87892923503/6-rules-of-thumb-for-mongodb-schema-design-part-2

Good luck.

like image 137
MrE Avatar answered Sep 28 '22 07:09

MrE