flarum / flarum/issue-archive

Revamp search API

Open
#286 26 comments 4 reactions 1 assignee Claimed by @askvortsov1 View on GitHub
type/feature
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

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.