Elasticlunr is a small, full-text search library for use in the Elixir environment. It indexes JSON documents and provides a friendly search interface to retrieve documents.
The library is built for web applications that do not require the deployment complexities of popular search engines while taking advantage of the Beam capabilities.
Imagine how much is gained when the search functionality of your application resides in the same environment (Beam VM) as your business logic; search resolves faster, the number of services (Elasticsearch, Solr, and so on) to monitor reduces.
The library can be installed by adding elasticlunr
to your list of dependencies in mix.exs:
def deps do
[
{:elasticlunr, "~> 0.6"}
]
end
Documentation can be found at hexdocs.pm. See blog post Introduction to Elasticlunr and Livebook for examples.
Sometimes users want to expand a query token to increase RECALL. For example, user query token is "micro", and assume "microwave" and "microscope" are in the index, if the user chooses to expand the query token "micro" to increase RECALL, both "microwave" and "microscope" will be returned and search in the index. The query results from expanded tokens are penalized because they are not the same as the query token.
The repository includes a livebook file that you can run. You can click the button below to run it using livebook.dev!
Elasticlunr allows you to write your indexes to whatever storage provider you want. You don't need to acess the Elasticlunr.Storage
module directly, it is used by the Elasticlunr.IndexManager
. See available providers below:
To configure what provider to use:
config :elasticlunr,
storage: Elasticlunr.Storage.S3
Note that all indexes in storage are preloaded on application startup. To see the available provider configuration, you should reference it module.
Elasticlunr is released under the MIT License - see the LICENSE file.