Elasticsearch
- Fuzzy matching
- Good at searching for text in a document db or unstructured data
- Is essentially a highly-indexed database
- Ranks results based on how close they are to the query
- Filtering data
- Good for unstructured data
- Create reverse- indexes on fields in the DB to search for them
Elasticsearch stores documents, indexes, mappings, and fields
- Documents are docs, JSON objects, etc.
- Indexes - Like a database table. It's a collection of searchable documents
- Mapping - which fields need to be searched for efficiently. You can also specify the data types here for range queries, etc.
- Elasticsearch maps terms (words, numbers) to document IDs
Reverse Indexes
- Features that we want to quickly search for - e.g. Tweets, usernames
- You can use something like CDC - change data capture which can update Elasticsearch whenever content in the db changes
Geospatial indexes