joystream icon indicating copy to clipboard operation
joystream copied to clipboard

Query node: sort forum posts search result by relevance

Open thesan opened this issue 3 years ago • 6 comments

➕ we need sorting by relevance (based on full text searches) to support ticket for THIS ISSUE

The Pioneer design now has a global search for council, proposal, and forum posts @figma.

For the forum section, there should be a way to sort by relevance the result of a query to the ForumPost which are filtered by thread title, post text and maybe later by tag.

┆Issue is synchronized with this Asana task by Unito

thesan avatar Sep 02 '21 08:09 thesan

Filtering by the thread title, etc. should be possible already. For sorting by the relevance, we need to expose the calculated relevance value provided by PostgresSQL's ts_rank. For that to work properly, we need to fix issues we are having with that function as described in https://github.com/Joystream/hydra/issues/455. Also, I have an impression that we will want to include forum posts' texts in multiple fulltext searches -> that's the goal of https://github.com/Joystream/hydra/issues/457.

ondratra avatar Sep 14 '21 08:09 ondratra

Yes AFAIK the filtering part works well, I just meant the result should be sortable by relevance. Currently it's done temporarily on the frontend.

thesan avatar Sep 14 '21 16:09 thesan

Is this still an issue?

bedeho avatar Dec 12 '21 07:12 bedeho

Is this still an issue?

Yes. The aggregation is still done on the front-end. Currently at most 500 results (not necessarily the most relevant) are fetch from the query node then the data is aggregated on the front-end and finally 20 results are rendered in the search side bar.

thesan avatar Dec 22 '21 10:12 thesan

Ok, adding it to Oylmpia scope, hopefully we can make a decision there.

bedeho avatar Dec 22 '21 10:12 bedeho

@ondratra assigning to you mate as per our agreement from Monday ;)

dmtrjsg avatar Jan 12 '22 10:01 dmtrjsg