Skip to content

Instantly share code, notes, and snippets.

@DeeNewcum
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeeNewcum/483802e292d69b1ae1f4 to your computer and use it in GitHub Desktop.
Save DeeNewcum/483802e292d69b1ae1f4 to your computer and use it in GitHub Desktop.
instructions for setting up Cloudsearch for reddit, by /user/kemitche on March 27, 2013
                 (this is a mirror of http://redd.it/1b3xp1)

Here's something to get you started:

You'll want to configure the following index fields and relevance sorts. The first dump is for the domain associated with your CLOUDSEARCH_SEARCH_API endpoint:

Fields:

author Active literal (Search Result)
author_fullname Active literal (Search)
downs Active uint ()
flair Active text () Sources: [function:Copy,name:flair_css_class,default:][function:Copy,name:flair_text,default:]
flair_css_class Active literal (Search)
flair_text Active text ()
fullname Active text (Result)
is_self Active uint ()
nsfw Active uint () Sources: [function:Copy,name:over18,default:]
num_comments Active uint ()
over18 Active uint ()
reddit Active literal (Facet)
self Active uint () Sources: [function:Copy,name:is_self,default:]
selftext Active text ()
site Active text (Result)
sr_id Active uint ()
subreddit Active text (Result)
text Active text () Sources: [function:Copy,name:title][function:Copy,name:author][function:Copy,name:subreddit][function:Copy,name:selftext][function:Copy,name:text]
timestamp Active uint ()
title Active text (Result)
ups Active uint ()
url Active text (Result)
hot Active (text_relevance + 1) * log10(max(1, ups - downs + num_comments)) + (timestamp - 1134028003) / (time() - 1134028003) * 1000.0
hot2 Active log10((text_relevance + 1) * max(1, ups - downs + num_comments)) * (timestamp - 1134028003) / 45000
relevance Active (text_relevance + 1) * log10(max(1, ups - downs + num_comments)) top Active max(1, ups - downs)


This next dump is for the fields you'll want for your CLOUDSEARCH_SUBREDDIT_SEARCH_API endpoint:

Fields:

activity Active uint ()
description Active text (Result)
header_title Active text ()
language Active literal (Search)
link_type Active literal (Search)
name Active literal (Search)
nsfw Active uint () Sources: [function:Copy,name:over18]
over18 Active uint ()
sidebar Active text (Result)
subscribers Active uint ()
text Active text () Sources: [function:Copy,name:name][function:Copy,name:title][function:Copy,name:description]
title Active text (Result)
type Active literal (Search)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment