Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify default Discourse weights #1681

Merged
merged 1 commit into from Mar 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/plugins/discourse/declaration.js
Expand Up @@ -12,7 +12,7 @@ export const topicNodeType: NodeType = deepFreeze({
name: "Topic",
pluralName: "Topics",
prefix: NodeAddress.append(nodePrefix, "topic"),
defaultWeight: 2,
defaultWeight: 0,
description:
"A topic (or post-container) in a Discourse instance. Every topic has at least one post.",
});
Expand All @@ -21,7 +21,7 @@ export const postNodeType: NodeType = deepFreeze({
name: "Post",
pluralName: "Posts",
prefix: NodeAddress.append(nodePrefix, "post"),
defaultWeight: 1,
defaultWeight: 0,
description: "A post in some topic in a Discourse instance.",
});

Expand All @@ -45,71 +45,71 @@ export const topicContainsPostEdgeType: EdgeType = deepFreeze({
forwardName: "contains post",
backwardName: "is contained by topic",
prefix: EdgeAddress.append(edgePrefix, "topicContainsPost"),
defaultWeight: {forwards: 1 / 16, backwards: 1 / 4},
defaultWeight: {forwards: 0, backwards: 1 / 8},
description: "Connects a topic to the posts that it contains.",
});

export const postRepliesEdgeType: EdgeType = deepFreeze({
forwardName: "post is reply to",
backwardName: "post replied to by",
prefix: EdgeAddress.append(edgePrefix, "replyTo"),
defaultWeight: {forwards: 1, backwards: 1 / 16},
defaultWeight: {forwards: 1 / 2, backwards: 0},
description: "Connects a post to the post that it is a reply to.",
});

export const authorsTopicEdgeType: EdgeType = deepFreeze({
forwardName: "authors topic",
backwardName: "topic is authored by",
prefix: EdgeAddress.append(edgePrefix, "authors", "topic"),
defaultWeight: {forwards: 1 / 4, backwards: 1},
defaultWeight: {forwards: 0, backwards: 1},
description: "Connects an author to a topic they created.",
});

export const authorsPostEdgeType: EdgeType = deepFreeze({
forwardName: "authors post",
backwardName: "post is authored by",
prefix: EdgeAddress.append(edgePrefix, "authors", "post"),
defaultWeight: {forwards: 1 / 4, backwards: 1},
defaultWeight: {forwards: 0, backwards: 1},
description: "Connects an author to a post they've created.",
});

export const createsLikeEdgeType: EdgeType = deepFreeze({
forwardName: "creates like",
backwardName: "like created by",
prefix: EdgeAddress.append(edgePrefix, "createsLike"),
defaultWeight: {forwards: 1, backwards: 1 / 16},
defaultWeight: {forwards: 1, backwards: 0},
description: "Connects a Discourse user to a like that they created.",
});

export const likesEdgeType: EdgeType = deepFreeze({
forwardName: "likes",
backwardName: "is liked by",
prefix: EdgeAddress.append(edgePrefix, "likes"),
defaultWeight: {forwards: 1, backwards: 1 / 16},
defaultWeight: {forwards: 1, backwards: 0},
description: "Connects a Discourse like to a post that was liked.",
});

export const referencesPostEdgeType: EdgeType = deepFreeze({
forwardName: "references post",
backwardName: "post is referenced by",
prefix: EdgeAddress.append(edgePrefix, "references", "post"),
defaultWeight: {forwards: 1 / 2, backwards: 1 / 16},
defaultWeight: {forwards: 1 / 2, backwards: 0},
description: "Connects a Discourse post to another post it referenced.",
});

export const referencesTopicEdgeType: EdgeType = deepFreeze({
forwardName: "references topic",
backwardName: "topic is referenced by",
prefix: EdgeAddress.append(edgePrefix, "references", "topic"),
defaultWeight: {forwards: 1 / 2, backwards: 1 / 16},
defaultWeight: {forwards: 1 / 2, backwards: 0},
description: "Connects a Discourse post to a topic it referenced.",
});

export const referencesUserEdgeType: EdgeType = deepFreeze({
forwardName: "mentions",
backwardName: "is mentioned by",
prefix: EdgeAddress.append(edgePrefix, "references", "user"),
defaultWeight: {forwards: 1 / 4, backwards: 1 / 16},
defaultWeight: {forwards: 1 / 4, backwards: 0},
description: "Connects a Discourse post to a user it mentions",
});

Expand Down