JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Multi-model search with Elasticsearch

Open
#1,035 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.3k
Forks
546
PR merge metrics
No merged PRs in 30d

Description

I'm beginning to implement autocomplete functionality in an Ember app that searches across a number of models. Has anyone accomplished something similar with JSONAPI::Resources? I'm planning to use the Chewy gem to interface with Elasticsearch.

Currently I'm thinking:

  • Either:
    • Potentially bypass JSONAPI::Resources altogether with JSONAPI::Utils
    • Custom index action that performs the search if autocomplete param is present
  • Or:
    • Add an autocomplete filter to an abstract SearchResource (not entirely sure this will work) that returns a heterogenous array of ActiveRecord models
  • Decorators or custom serializes for search so all records have the same attribute signature

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files or tests are named. Start by reviewing the JSONAPI::Resources extension points alongside Chewy and JSONAPI::Utils, then determine whether multi-model autocomplete belongs in a custom index action or an abstract SearchResource. Done means a decided approach for heterogeneous results and consistent serialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, ruby
Domain
backend-api-design, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.