heywhy / ex_elasticlunr

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.
https://hexdocs.pm/elasticlunr
MIT License
189 stars 9 forks source link

Change Query DSL To Map #4

Closed heywhy closed 2 years ago

heywhy commented 2 years ago

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 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

Testing

How to test:

Write down steps needed, if any, to test your PR locally in case the preview links do not work

  1. Create an index
  2. Add some documents to the index
  3. Confirm that search works when given a map for query

What to test: