Reputation: 1114
We're getting a lot of errors in some of our search pages that were probably caused by having too many records in our mySQL DB. We're thinking of ways on how to resolve it. One of which is trying out ElasticSearch. We will still store all the data in our mySQL DB but use the power of ElasticSearch for some querying purposes.
So, how can we implement ElasticSearch with our website built using C# that currently has a mySQL DB for data storage?
Note: For the sake of directly answering my question, just assume that there is no other way to resolve our issue on the search pages other than using ElasticSearch.
Upvotes: 3
Views: 1497
Reputation: 974
If anyone finds this thread through search: Elastic has deprecated the use of rivers. They promote the usage of external tools to fill your index with data from a database.
The blog article mentioned above has been updated and there's a new one to help people implement a tool that can keep Elasticsearch up-to-date with data from an sql database: http://voormedia.com/blog/2015/12/how-we-keep-our-elasticsearch-updated-with-mssql-database.
Upvotes: 3
Reputation: 8540
I guess first you need to understand how inverted indexing works, to make sure, that ElasticSearch is right solution for you: http://en.wikipedia.org/wiki/Inverted_index
Then you'll need to come up with your indexing strategy: what and how you'll be indexing your data from mysql to ElasticSearch. Thing is, that in relational data you're operating on rows, in inverted index (ElasticSearch, Solr, Lucene, etc.) you're operating on documents, so you need to decide how you transform your relational data to documents, there are several approaches and there's great article about possible ways to index relational data in ElasticSearch: http://voormedia.com/blog/2014/06/four-ways-to-index-relational-data-in-elasticsearch
Upvotes: 1
Reputation: 681
You need to have elasticsearch river plugin that periodically pulls data from mySQL and index it on elasticsearch. Couple of such plugins, I came across
elasticsearch-river-jdbc - https://github.com/jprante/elasticsearch-river-jdbc Elasticsearch-MySQL-River - https://github.com/mallocator/Elasticsearch-MySQL-River
Once you have your data indexed on elasticsearch, you can search them using,
Upvotes: 1
Reputation: 1069
You can use the jdbc river to connect elastic search to your mysql db, or you can write custom C# code using NEST to load your data into Elasticsearch. Also give this answer a read.
Upvotes: 0