Skip to content

Commit

Permalink
Add missing status to Kitsune/SUMO index
Browse files Browse the repository at this point in the history
There is a new field in the enriched index, `status`,
which contains the current status of the question.
The status could be `solved`, `archived`, `locked`,
or `open`.

Signed-off-by: Jose Javier Merchante <jjmerchante@bitergia.com>
  • Loading branch information
jjmerchante authored and sduenas committed Sep 18, 2024
1 parent 349d594 commit 44b2cd4
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
10 changes: 10 additions & 0 deletions grimoire_elk/enriched/kitsune.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ def get_rich_item(self, item, kind='question', equestion=None):
origin = item['origin'].rstrip('/')
eitem['url'] = f"{origin}/{question['locale']}/questions/{question['id']}"

# Add status
if question['is_solved']:
eitem['status'] = 'solved'
elif question['is_archived']:
eitem['status'] = 'archived'
elif question['is_locked']:
eitem['status'] = 'locked'
else:
eitem['status'] = 'open'

eitem['author'] = question['creator']['username']
if question['creator']['display_name']:
eitem['author'] = question['creator']['display_name']
Expand Down
8 changes: 8 additions & 0 deletions releases/unreleased/status-in-sumo-enriched-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Status in SUMO enriched index
category: added
author: Jose Javier Merchante <jjmerchante@bitergia.com>
issue: null
notes: >
Add the missing status in the SUMO backend. The status could
be `solved`, `archived`, `locked` or `open`.
58 changes: 58 additions & 0 deletions schema/kitsune.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name,type,aggregatable,description
answer_id,long,True,"Unique identifier for the answer."
author,keyword,True,"Name of the author."
author_bot,boolean,True,"Indicates whether the author is a bot."
author_gender,keyword,True,"Gender of the author."
author_gender_acc,long,True,"Accuracy or confidence level for the author's gender identification."
author_id,keyword,True,"Unique identifier for the author."
author_multi_org_names,keyword,True,"List of multiple organization names associated with the author."
author_name,keyword,True,"Full name of the author."
author_org_name,keyword,True,"Organization name associated with the author."
author_user_name,keyword,True,"Username of the author."
author_uuid,keyword,True,"Unique UUID for the author."
content,keyword,True,"Content of the post or answer as a single string."
content_analyzed,text,False,"Content of the post or answer, analyzed for searching."
creation_date,date,True,"Date when the content was created."
creator_bot,boolean,True,"Indicates whether the creator is a bot."
creator_gender,keyword,True,"Gender of the creator."
creator_gender_acc,long,True,"Accuracy or confidence level for the creator's gender identification."
creator_id,keyword,True,"Unique identifier for the creator."
creator_multi_org_names,keyword,True,"List of multiple organization names associated with the creator."
creator_name,keyword,True,"Full name of the creator."
creator_org_name,keyword,True,"Organization name associated with the creator."
creator_user_name,keyword,True,"Username of the creator."
creator_uuid,keyword,True,"Unique UUID for the creator."
grimoire_creation_date,date,True,"Date when the item was created upstream, typically the date the question or answer was created."
helpful_answer,long,True,"Field indicating whether the answer was marked as helpful."
id,keyword,True,"Unique identifier for the entity (question or answer)."
is_kitsune_answer,long,True,"Field containing '1' if the item is a Kitsune answer."
is_kitsune_question,long,True,"Field containing '1' if the item is a Kitsune question."
is_kitsune_question_solved,long,True,"Field containing '1' if the Kitsune question is marked as solved."
is_spam,boolean,True,"Field indicating whether the content is flagged as spam."
last_activity_date,date,True,"Date when the last activity occurred on the item (question or answer)."
lifetime_days,float,False,"The total lifetime of the question or answer in days."
locale,keyword,True,"Locale or language in which the content was written."
metadata__enriched_on,date,True,"Date when the item was enriched."
metadata__gelk_backend_name,keyword,True,"Name of the backend used to enrich information."
metadata__gelk_version,keyword,True,"Version of the backend used to enrich information."
metadata__timestamp,date,True,"Timestamp when the item was indexed."
metadata__updated_on,date,True,"Date when the item was updated in its original data source."
num_answers,long,True,"Number of answers associated with the question."
offset,long,True,"Offset of the document in the data source."
origin,keyword,True,"Original URL where the data was retrieved from."
product,keyword,True,"Product associated with the question or answer."
project,keyword,True,"Project name associated with the question or answer."
project_1,keyword,True,"Additional project information if multiple project levels exist."
question_id,long,True,"Unique identifier for the question."
score,long,True,"Score or rating given to the question or answer."
solution,long,True,"Field indicating whether the answer is marked as a solution."
status,keyword,True,"Status of the question or answer (open, archived, locked, solved)."
tag,keyword,True,"Tag associated with the origin."
tags,keyword,True,"List of tags associated with the question or answer."
tags_analyzed,text,False,"Tags analyzed for searching."
time_to_first_reply_hours,float,False,"Time taken to receive the first reply, measured in hours."
title,keyword,True,"Title of the question or answer."
type,keyword,True,"Type of content (e.g., question, answer)."
unhelpful_answer,long,True,"Field indicating whether the answer was marked as unhelpful."
url,keyword,True,"URL corresponding to the question or answer."
uuid,keyword,True,"Unique identifier (UUID) for the entity."

0 comments on commit 44b2cd4

Please sign in to comment.