Lucien Lee
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# 「設計討論」需複查回應列表 ## 需求 針對已經有至少一則回覆的文章訊息,希望可以鼓勵其他編輯進行複查,讓更多意見能被看見,包含對已有回應的 upvote 與 dovote 或是新增更好的回應。 而目前在 Cofacts 網站上,編輯其實很難找出這些「需要複查的訊息」。 (最主要的原因也是先不提複查,現有的大量訊息也不在可以被回應第二次的機會) ## 希望需要複查的回應 1. 即將會通知 chatbot 使用者的新回應 > articles 按照最新 `normal` articleReply 的最新 `createdAt` 排序 > Ref: Nested sorting https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-sort.html#nested-sorting > ``` > POST /articles/_search > { > "query": { > "match_all": {} > }, > "sort": [ > { > "articleReplies.createdAt": { > "order": "desc", > "mode": "max", > "nested": { > "path": "articleReplies", > "filter": { > "term": { > "articleReplies.status": "NORMAL" > } > } > } > } > } > ] > } > ``` > ![](https://i.imgur.com/AfYBjYQ.png) 2. 其他條件/短期內被大量回應的訊息(編輯吵起來?) - `# of (article reply creation time < X days) > Y` - ex: https://cofacts.g0v.tw/article/2wo7u0pccfbx0 :::danger 「article list, Sort by 特定時間內回應」這件事情做不到,因為在 [script sort](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-request-sort.html#_script_based_sorting) 無法存取 nested object `articleReplies`。 https://discuss.elastic.co/t/help-for-painless-iterate-nested-fields/162394/2 看起來只有 mutation API 能存取完整含 nested object 的 `ctx._source`,search / sort 系列的 API 在 script 裡只能拿不含 nested object 的 `doc_value` https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-fields.html ::: 4. 有爭議性的文章提供列表或標記整理 > 「沒有半個回應被標成有用」的文章列表,用「最新一則僅有負評的回應時間」排序 > - 有任何一個回應被標成有用,就會從此文章列表消失,新回應有負評也不會出現 > - 沒有「articles 按照最新 `normal` articleReply 的最新 `createdAt` 排序」來得實用,**不建議實作**。 > > ``` > POST /articles/_search > { > "query": { > "bool": { > "must_not": [ > { > "nested": { > "path": "articleReplies", > "query": { > "range": { > "articleReplies.positiveFeedbackCount": { > "gt": 0 > } > } > } > } > } > ] > } > }, > "sort": [ > { > "articleReplies.createdAt": { > "order": "desc", > "mode": "max", > "nested": { > "path": "articleReplies", > "filter": { > "bool": { > "must": [ > { > "range": { > "articleReplies.positiveFeedbackCount": { > "lte": 0 > } > } > }, > { > "range": { > "articleReplies.negativeFeedbackCount": { > "gte": 1 > } > } > }, > { > "term": { > "articleReplies.status": "NORMAL" > } > } > ] > } > } > } > } > } > ] > } > ``` > > ### 如何定義需複查 文章/回應 可能要素 * 文章新增時間 => 還沒被很多編輯看到,希望有更多回應? * 回應新增時間 => 新回應需要得到 upvote/ downvote。但如果在已有很多回應的文章中,新回應還需要被看見嗎 * 回應稀少 * 回應正反交鋒激烈 => 有爭議性 * `articleReply[].replyType` 的比值:試試看 [script query](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-script-query.html) 需要研究 :::danger 「`articleReply[].replyType` 的比值」這件事情做不到,理由同上。 ::: 假想條件 * 回應數量不夠(請定義"不夠"唷) * 回應被 downvote ## 希望編輯的操作 針對回應進行 upvote / downvote 增加一篇新回應 => 有可以造成 infinite recursive,需複查新回應的回應又進入需複查。 --- orz: sort 可以用 max(articleReply.createdAt) lucien 如果我想要讓數量是 order 的條件,有辦法嗎 orz 有 `normalArticleReplyCount` 但可能無法 sort by aggregation result lucien 可能要再設 tab - 看新的 - 看回應多的 ( https://cofacts.g0v.tw/article/2wo7u0pccfbx0 , https://cofacts.g0v.tw/article/2a41kke3f59qw ) 但中間的會看不到 orz 我覺得這樣還好 lucien 可以自訂 sort score 結合兩個 tab 嗎 orz sort 可以下 script https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-sort.html#_script_based_sorting ## 預計產出 一頁新的文章回應列表: 每個項目為 - 文章訊息原文 - 被聚合的需複查之回應 - 被聚合的需複查之回應 - ... - 文章訊息原文 - ... - ... 列表進入後 _文章頁_ ,可以針對需複查的訊息進行焦點顯示 -----

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully