<commit_before>Stories._ensureIndex({
  shortId: 1
}, {
  unique: 1
});

Stories._ensureIndex({
  published: 1
});

Stories._ensureIndex({
  authorId: 1
});

ContextBlocks._ensureIndex({
  authorId: 1
});

StoryStats._ensureIndex({
  storyId: 1
});

Meteor.users._ensureIndex({
  username: 1
});

Meteor.publish("curatedStoriesPub", function() {
  return Stories.find({
    published: true,
    editorsPick: true
  }, {
    fields: {
      draftStory: 0,
      history: 0
    },
    sort: {
      editorsPickAt: -1
    },
    limit: 40 // initial limit
  });
});

Meteor.publish("newestStoriesPub", function() { // for now, it's just publishedAt (later should maybe be firstPublishedAt)
  return Stories.find({
    published: true
  }, {
    fields: {
      draftStory: 0,
      history: 0
    },
    sort: {
      publishedAt: -1
    },
    limit: 40 // initial limit
  });
});

Meteor.publish("trendingStoriesPub", function() { // for now, it's just the most views
  return Stories.find({
    published: true
  }, {
    fields: {
      draftStory: 0,
      history: 0
    },
    sort: {
      views: -1
    },
    limit: 40 // initial limit
  });
});

Meteor.publish("favoriteStoriesPub", function(ids) { // requires ids to be passed in
  return Stories.find({
    published: true,
    _id: { $in : ids }
  }, {
    fields: {
      draftStory: 0,
      history: 0<commit_msg>add sort to favorites pub for better oblog support<commit_after>Stories._ensureIndex({
  shortId: 1
}, {
  unique: 1
});

Stories._ensureIndex({
  published: 1
});

Stories._ensureIndex({
  authorId: 1
});

ContextBlocks._ensureIndex({
  authorId: 1
});

StoryStats._ensureIndex({
  storyId: 1
});

Meteor.users._ensureIndex({
  username: 1
});

Meteor.publish("curatedStoriesPub", function() {
  return Stories.find({
    published: true,
    editorsPick: true
  }, {
    fields: {
      draftStory: 0,
      history: 0
    },
    sort: {
      editorsPickAt: -1
    },
    limit: 40 // initial limit
  });
});

Meteor.publish("newestStoriesPub", function() { // for now, it's just publishedAt (later should maybe be firstPublishedAt)
  return Stories.find({
    published: true
  }, {
    fields: {
      draftStory: 0,
      history: 0
    },
    sort: {
      publishedAt: -1
    },
    limit: 40 // initial limit
  });
});

Meteor.publish("trendingStoriesPub", function() { // for now, it's just the most views
  return Stories.find({
    published: true
  }, {
    fields: {
      draftStory: 0,
      history: 0
    },
    sort: {
      views: -1
    },
    limit: 40 // initial limit
  });
});

Meteor.publish("favoriteStoriesPub", function(ids) { // requires ids to be passed in
  return Stories.find({
    published: true,
    _id: { $in : ids }
  }, {
    fields: {
      draftStory: 0,
      history: 0
    },
    sort: {
      publishedAt: -1
{'fraction_non_alphanumeric': 0.1440677966101695, 'fraction_numerical': 0.01730225988700565, 'mean_word_length': 2.510532837670384, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6777824', 'n_tokens_mistral': 1015, 'n_tokens_neox': 940, 'n_words': 236}