flarum / flarum/issue-archive

Revamp search API

Open
#288 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Plan for new search system:

Search driver (eg. Algolia) is called upon to update its index each time a post/discussion is changed
(Each post is a separate object in the index which contains not only post content but also its discussion's title/tags/other metadata)

q = foo "bar baz" (author:toby OR author:franz) is:following

  1. Parse q into an abstracted query object
. eg. https://github.com/pimcore/search-query-parser or https://github.com/netgen/query-translator
  2. Loop through each Term in the query object, allow gambits to match and convert term into a Where object to be processed by search driver
  3. Extensions may also populate the query object to enact permissions, eg. add a Where to restrict results to only tags that the user can see
  4. Search driver builds its vendor-specific query by inspecting query object's Terms/Wheres, returns list of discussion IDs

However, this is complex and will take a while to implement, so it would be wise to keep it slated for 0.2 (as per current roadmap). In the meantime, we are doing flarum/framework#1339

Contributor guide

Open the contributing guide

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

Start by reading the linked flarum/framework#1339 issue and the current 0.2 roadmap, then compare the proposed parser, Term/Where, extension, and search-driver responsibilities with the existing search implementation. This issue does not identify files, tests, or an agreed implementation boundary, and completion is deferred rather than defined.

Written by the indexing model from the issue text.

Assessment

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