Added NSFW filter to query #122

Merged
marcdeb1 merged 3 commits from nsfw_filter into master 2018-10-21 22:34:17 +02:00
marcdeb1 commented 2018-10-17 11:57:18 +02:00 (Migrated from github.com)

Nsfw parameter added to input, for example :
http://127.0.0.1:50005/search?s=lbry&nsfw=true
returns only nsfw results (see issue #110).
Other filters can easily added to the getFilters function.

Nsfw parameter added to input, for example : http://127.0.0.1:50005/search?s=lbry&nsfw=true returns only nsfw results (see issue #110). Other filters can easily added to the getFilters function.
tiger5226 (Migrated from github.com) reviewed 2018-10-18 02:37:43 +02:00
@ -246,2 +220,4 @@
'value.stream.metadata.title',
'value.stream.metadata.description',
],
},
tiger5226 (Migrated from github.com) commented 2018-10-18 02:37:43 +02:00

This worked? I need to double check but I thought it stores the value in elastic search in the same way it is grabbed from Chainquery [0,1]

This worked? I need to double check but I thought it stores the value in elastic search in the same way it is grabbed from Chainquery [[0,1]](https://chainquery.lbry.io/api/sql?query=SELECT%20name,is_nsfw%20FROM%20claim%20WHERE%20name%20=%22awakeningshortfilm%22)
marcdeb1 (Migrated from github.com) reviewed 2018-10-18 08:24:02 +02:00
@ -246,2 +220,4 @@
'value.stream.metadata.title',
'value.stream.metadata.description',
],
},
marcdeb1 (Migrated from github.com) commented 2018-10-18 08:24:02 +02:00

Do you mean for value.stream.metadata.nsfw ? There is no nsfw field at the top level like for "channel", it's inside the value object.

Do you mean for value.stream.metadata.nsfw ? There is no nsfw field at the top level like for "channel", it's inside the value object.
tiger5226 (Migrated from github.com) reviewed 2018-10-19 03:22:31 +02:00
@ -246,2 +220,4 @@
'value.stream.metadata.title',
'value.stream.metadata.description',
],
},
tiger5226 (Migrated from github.com) commented 2018-10-19 03:22:31 +02:00

yeah, you are comparing value.stream.metadata.nsfw to input.nsfw. I was just saying that I thought one is a number and one is string. I am not too great with javascript. Maybe [0,1] is mapped to true/false automatically. I just need to load up the branch locally to validate. I will do this soon. Thanks for the PR!

yeah, you are comparing `value.stream.metadata.nsfw` to `input.nsfw`. I was just saying that I thought one is a number and one is string. I am not too great with javascript. Maybe `[0,1]` is mapped to `true/false` automatically. I just need to load up the branch locally to validate. I will do this soon. Thanks for the PR!
marcdeb1 (Migrated from github.com) reviewed 2018-10-19 10:16:14 +02:00
@ -246,2 +220,4 @@
'value.stream.metadata.title',
'value.stream.metadata.description',
],
},
marcdeb1 (Migrated from github.com) commented 2018-10-19 10:16:14 +02:00
It's stored as true/false in Elasticsearch https://www.elastic.co/guide/en/elasticsearch/reference/current/boolean.html#boolean
tiger5226 (Migrated from github.com) approved these changes 2018-10-21 06:09:35 +02:00
tiger5226 (Migrated from github.com) left a comment

Looks good now

Looks good now
tiger5226 commented 2018-10-21 06:10:27 +02:00 (Migrated from github.com)

@filipnyquist I reviewed this and tested it locally. All is well. If you have any comments, please note them, otherwise I will merge and deploy this early in the week.

@filipnyquist I reviewed this and tested it locally. All is well. If you have any comments, please note them, otherwise I will merge and deploy this early in the week.
marcdeb1 commented 2018-10-22 07:46:28 +02:00 (Migrated from github.com)

Thanks for adding the docs !

Thanks for adding the docs !
tzarebczan commented 2018-10-30 00:54:03 +01:00 (Migrated from github.com)

@marcdeb1, please shoot us an email to hello@lbry.io with a time estimate for this one too :)

Thanks for the PR!

@marcdeb1, please shoot us an email to hello@lbry.io with a time estimate for this one too :) Thanks for the PR!
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lighthouse.js#122
No description provided.