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 initial design of the DSL parse function expects a keyword. But this initial decision is not optimal for situations where one decides to pass a JSON received from an API directly to the Index.search(...). And one of the goals for the project is to provide a web layer that accepts these queries and passes them to the search function of the corresponding index.
And these changes contain the foundation for adding documents with nested attributes and being able to search by these nested attributes.
TODO
[x] Add error handling
[x] Add Loom video demo
[x] GitHub Actions are all passing
Testing
How to test:
Write down steps needed, if any, to test your PR locally in case the preview links do not work
Create an index
Add some documents to the index
Confirm that search works when given a map for query
What to test:
[x] One can only add fields whose name is a binary/string
[x] When given a map, the parse function works correctly
[x] Fields are added explicitly by calling Index.add_field on an index
Overview
The initial design of the DSL
parse
function expects a keyword. But this initial decision is not optimal for situations where one decides to pass a JSON received from an API directly to theIndex.search(...)
. And one of the goals for the project is to provide a web layer that accepts these queries and passes them to the search function of the corresponding index.And these changes contain the foundation for adding documents with nested attributes and being able to search by these nested attributes.
TODO
Testing
How to test:
Write down steps needed, if any, to test your PR locally in case the preview links do not work
What to test:
Index.add_field
on an index