Joystream / Joystream/joystream

Issues with the `search` query

Open
#2,800 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

qn-hydra-board query-node should-have to-triage
Dominant language
Rust
Stars
1.4k
Forks
116
PR merge metrics
No merged PRs in 30d

Description

I think we found a couple of bugs related to the search query, at least according to my understanding of how that should work. So to start off here's how I expect the query to work, let me know if I have some bad assumptions: Using the text query argument we indicate what keyword we want to search for. Then whereVideo argument is used to filter video results from the initial search and whereChannel is used to filter channels. Changes to whereChannel shouldn't impact filtered videos and vice versa.

So here are the issues I've noticed:

  1. Providing whereChannel breaks filtering of videos. If you run search(text: "test", whereVideo:{languageId_eq:"en"}), you will get an expected list of results, videos filtered by en language and some channels. However, if you add whereChannel: {} to that query (which shouldn't impact videos at all), videos are not properly filtered anymore and you will get some videos with ru language.
  2. Similar to the above case, if you run a query with both channels and videos filtered by some language, e.g. search(text: "test", whereVideo:{languageId_eq:"en"}, whereChannel: {languageId_eq: "ru"}), both videos and channels will have wrong results (in a different language).
  3. Providing only channel language filter (search(text: "test", whereChannel: {languageId_eq: "ru"})), it seems the resulting videos are filtered by the same language as well.

I think there may be more symptoms of this problem, those are just some scenarios that I found, but I guess they may have a common cause. Also, I don't know if this relates only to language filter, that's just what I used for testing.

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

Start by reproducing the three search queries in the issue, comparing video and channel language results when each filter is present or absent. Trace the search query implementation and its existing tests, if any; done means whereVideo and whereChannel filter their respective results independently without changing the other result set.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, rust
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.