針對已經有至少一則回覆的文章訊息,希望可以鼓勵其他編輯進行複查,讓更多意見能被看見,包含對已有回應的 upvote 與 dovote 或是新增更好的回應。
而目前在 Cofacts 網站上,編輯其實很難找出這些「需要複查的訊息」。
(最主要的原因也是先不提複查,現有的大量訊息也不在可以被回應第二次的機會)
articles 按照最新
normal
articleReply 的最新createdAt
排序
Ref: Nested sorting https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-sort.html#nested-sortingPOST /articles/_search { "query": { "match_all": {} }, "sort": [ { "articleReplies.createdAt": { "order": "desc", "mode": "max", "nested": { "path": "articleReplies", "filter": { "term": { "articleReplies.status": "NORMAL" } } } } } ] }
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
# of (article reply creation time < X days) > Y
「article list, Sort by 特定時間內回應」這件事情做不到,因為在 script sort 無法存取 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
「沒有半個回應被標成有用」的文章列表,用「最新一則僅有負評的回應時間」排序
- 有任何一個回應被標成有用,就會從此文章列表消失,新回應有負評也不會出現
- 沒有「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 需要研究「articleReply[].replyType
的比值」這件事情做不到,理由同上。
假想條件
針對回應進行 upvote / downvote
增加一篇新回應 => 有可以造成 infinite recursive,需複查新回應的回應又進入需複查。
orz:
sort 可以用 max(articleReply.createdAt)
lucien
如果我想要讓數量是 order 的條件,有辦法嗎
orz
有 normalArticleReplyCount
但可能無法 sort by aggregation result
lucien
可能要再設 tab
但中間的會看不到
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
一頁新的文章回應列表:
每個項目為
- 文章訊息原文
- 被聚合的需複查之回應
- 被聚合的需複查之回應
- …
- 文章訊息原文
- …
- …
列表進入後 文章頁 ,可以針對需複查的訊息進行焦點顯示
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
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.
Syncing