consts

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 0 Imported by: 24

Documentation

Index

Constants

View Source
const (
	// Collection Types
	CT_ARTICLES           = "ARTICLES"
	CT_BOOKS              = "BOOKS"
	CT_CHILDREN_LESSONS   = "CHILDREN_LESSONS"
	CT_CLIPS              = "CLIPS"
	CT_CONGRESS           = "CONGRESS"
	CT_DAILY_LESSON       = "DAILY_LESSON"
	CT_FRIENDS_GATHERINGS = "FRIENDS_GATHERINGS"
	CT_HOLIDAY            = "HOLIDAY"
	CT_LECTURE_SERIES     = "LECTURE_SERIES"
	CT_LESSONS_SERIES     = "LESSONS_SERIES"
	CT_MEALS              = "MEALS"
	CT_PICNIC             = "PICNIC"
	CT_SONGS              = "SONGS"
	CT_SPECIAL_LESSON     = "SPECIAL_LESSON"
	CT_UNITY_DAY          = "UNITY_DAY"
	CT_VIDEO_PROGRAM      = "VIDEO_PROGRAM"
	CT_VIRTUAL_LESSONS    = "VIRTUAL_LESSONS"
	CT_WOMEN_LESSONS      = "WOMEN_LESSONS"

	// Content Unit Types
	CT_ARTICLE               = "ARTICLE"
	CT_BLOG_POST             = "BLOG_POST"
	CT_BOOK                  = "BOOK"
	CT_CHILDREN_LESSON       = "CHILDREN_LESSON"
	CT_CLIP                  = "CLIP"
	CT_EVENT_PART            = "EVENT_PART"
	CT_FRIENDS_GATHERING     = "FRIENDS_GATHERING"
	CT_FULL_LESSON           = "FULL_LESSON"
	CT_KITEI_MAKOR           = "KITEI_MAKOR"
	CT_LECTURE               = "LECTURE"
	CT_LELO_MIKUD            = "LELO_MIKUD"
	CT_LESSON_PART           = "LESSON_PART"
	CT_MEAL                  = "MEAL"
	CT_PUBLICATION           = "PUBLICATION"
	CT_RESEARCH_MATERIAL     = "RESEARCH_MATERIAL"
	CT_KTAIM_NIVCHARIM       = "KTAIM_NIVCHARIM"
	CT_SONG                  = "SONG"
	CT_TRAINING              = "TRAINING"
	CT_UNKNOWN               = "UNKNOWN"
	CT_VIDEO_PROGRAM_CHAPTER = "VIDEO_PROGRAM_CHAPTER"
	CT_VIRTUAL_LESSON        = "VIRTUAL_LESSON"
	CT_WOMEN_LESSON          = "WOMEN_LESSON"
	CT_SOURCE                = "SOURCE"
	CT_LIKUTIM               = "LIKUTIM"

	// Content types for additional Elastic results
	SCT_BLOG_POST = "R_BLOG_POST"
	SCT_TWEET     = "R_TWEET"

	// Content Role types
	CR_LECTURER = "LECTURER"

	// Persons patterns
	P_RAV = "rav"

	// Source types
	SRC_TYPE_COLLECTION = 1
	SRC_TYPE_BOOK       = 2
	SRC_TYPE_VOLUME     = 3
	SRC_TYPE_PART       = 4
	SRC_TYPE_PARASHA    = 5
	SRC_TYPE_CHAPTER    = 6
	SRC_TYPE_ARTICLE    = 7
	SRC_TYPE_TITLE      = 8
	SRC_TYPE_LETTER     = 9
	SRC_TYPE_ITEM       = 10

	// Security levels
	SEC_PUBLIC    = int16(0)
	SEC_SENSITIVE = int16(1)
	SEC_PRIVATE   = int16(2)

	// Weight of 'sources' and 'collections' autocomplete results (assigned at index time)
	ES_SOURCES_SUGGEST_DEFAULT_WEIGHT     = 50
	ES_COLLECTIONS_SUGGEST_DEFAULT_WEIGHT = 40

	ES_GRAMMAR_SUGGEST_DEFAULT_WEIGHT = 100

	// Languages
	LANG_ENGLISH    = "en"
	LANG_HEBREW     = "he"
	LANG_RUSSIAN    = "ru"
	LANG_SPANISH    = "es"
	LANG_ITALIAN    = "it"
	LANG_GERMAN     = "de"
	LANG_DUTCH      = "nl"
	LANG_FRENCH     = "fr"
	LANG_PORTUGUESE = "pt"
	LANG_TURKISH    = "tr"
	LANG_POLISH     = "pl"
	LANG_ARABIC     = "ar"
	LANG_HUNGARIAN  = "hu"
	LANG_FINNISH    = "fi"
	LANG_LITHUANIAN = "lt"
	LANG_JAPANESE   = "ja"
	LANG_BULGARIAN  = "bg"
	LANG_GEORGIAN   = "ka"
	LANG_NORWEGIAN  = "no"
	LANG_SWEDISH    = "sv"
	LANG_CROATIAN   = "hr"
	LANG_CHINESE    = "zh"
	LANG_PERSIAN    = "fa"
	LANG_ROMANIAN   = "ro"
	LANG_HINDI      = "hi"
	LANG_UKRAINIAN  = "ua"
	LANG_MACEDONIAN = "mk"
	LANG_SLOVENIAN  = "sl"
	LANG_LATVIAN    = "lv"
	LANG_SLOVAK     = "sk"
	LANG_CZECH      = "cs"
	LANG_AMHARIC    = "am"
	LANG_MULTI      = "zz"
	LANG_UNKNOWN    = "xx"
)
View Source
const (
	INTENTS_SEARCH_DEFAULT_COUNT              = 10
	INTENTS_SEARCH_BY_FILTER_GRAMMAR_COUNT    = 2
	TWEETS_SEARCH_COUNT                       = 20
	INTENTS_MIN_UNITS                         = 3
	MAX_CLASSIFICATION_INTENTS                = 3
	API_DEFAULT_PAGE_SIZE                     = 50
	API_MAX_PAGE_SIZE                         = 1000
	MIN_RESULTS_SCORE_TO_IGNOGRE_TYPO_SUGGEST = 100
	// Consider making a carusele and not limiting.
	MAX_MATCHES_PER_GRAMMAR_INTENT                  = 3
	FILTER_GRAMMAR_INCREMENT_FOR_MATCH_TO_FULL_TERM = 200
	CONTENT_TYPE_INTENTS_BOOST                      = 8.0 // For priority between several filter intent types
	SCORE_INCREMENT_FOR_SEARCH_WITHOUT_TERM_RESULTS = 200.0
	MAX_GRAMMAR_INTENTS_FOR_FILTER_SEARCH           = 4
)
View Source
const (
	SORT_BY_RELEVANCE      = "relevance"
	SORT_BY_NEWER_TO_OLDER = "newertoolder"
	SORT_BY_OLDER_TO_NEWER = "oldertonewer"
	SORT_BY_SOURCE_FIRST   = "sourcefirst"
)
View Source
const (
	FILTER_TAG                       = "tag"
	FILTER_START_DATE                = "start_date"
	FILTER_END_DATE                  = "end_date"
	FILTER_SOURCE                    = "source"
	FILTER_AUTHOR                    = "author"
	FILTER_UNITS_CONTENT_TYPES       = "units_content_types"
	FILTER_COLLECTIONS_CONTENT_TYPES = "collections_content_types"
	FILTER_SECTION_SOURCES           = "filter_section_sources"
	FILTER_LANGUAGE                  = "media_language"
	FILTER_COLLECTION                = "collection"
)
View Source
const (
	MEDIA_MP4  = "video/mp4"
	MEDIA_MP3  = "audio/mpeg"
	MEDIA_MP3a = "audio/mpeg"
	MEDIA_MP3b = "audio/mp3"
)
View Source
const (
	INTENT_TYPE_TAG    = "tag"
	INTENT_TYPE_SOURCE = "source"

	INTENT_INDEX_TAG         = "intent-tag"
	INTENT_INDEX_SOURCE      = "intent-source"
	INTENT_HIT_TYPE_PROGRAMS = "programs"
	INTENT_HIT_TYPE_LESSONS  = "lessons"
)

Search intents

View Source
const (
	GRAMMAR_INDEX = "grammar"

	GRAMMAR_TYPE_FILTER              = "filter"
	GRAMMAR_TYPE_FILTER_WITHOUT_TERM = "filter_without_term"
	GRAMMAR_TYPE_LANDING_PAGE        = "landing-page"
	GRAMMAR_TYPE_CLASSIFICATION      = "classification"

	GRAMMAR_INTENT_FILTER_BY_CONTENT_TYPE         = "by_content_type"
	GRAMMAR_INTENT_FILTER_BY_SOURCE               = "by_source"
	GRAMMAR_INTENT_FILTER_BY_PROGRAM              = "by_program"
	GRAMMAR_INTENT_FILTER_BY_PROGRAM_WITHOUT_TERM = "by_program_without_term"
	GRAMMAR_INTENT_SOURCE_POSITION_WITHOUT_TERM   = "source_position_without_term"
	GRAMMAR_INTENT_PROGRAM_POSITION_WITHOUT_TERM  = "program_position_without_term"

	GRAMMAR_LP_SINGLE_COLLECTION = "grammar_landing_page_single_collection_from_sql"
	GRAMMAR_GENERATED_CU_HIT     = "grammar_generated_content_unit_hit"
	GRAMMAR_GENERATED_SOURCE_HIT = "grammar_generated_source_hit"

	GRAMMAR_INTENT_LANDING_PAGE_LESSONS            = "lessons"
	GRAMMAR_INTENT_LANDING_PAGE_VIRTUAL_LESSONS    = "virtual_lessons"
	GRAMMAR_INTENT_LANDING_PAGE_LECTURES           = "lectures"
	GRAMMAR_INTENT_LANDING_PAGE_WOMEN_LESSONS      = "women_lessons"
	GRAMMAR_INTENT_LANDING_PAGE_RABASH_LESSONS     = "rabash_lessons"
	GRAMMAR_INTENT_LANDING_PAGE_LESSON_SERIES      = "lesson_series"
	GRAMMAR_INTENT_LANDING_PAGE_PRORGRAMS          = "programs"
	GRAMMAR_INTENT_LANDING_PAGE_CLIPS              = "clips"
	GRAMMAR_INTENT_LANDING_PAGE_LIBRARY            = "library"
	GRAMMAR_INTENT_LANDING_PAGE_GROUP_ARTICLES     = "group_articles"
	GRAMMAR_INTENT_LANDING_PAGE_CONVENTIONS        = "conventions"
	GRAMMAR_INTENT_LANDING_PAGE_HOLIDAYS           = "holidays"
	GRAMMAR_INTENT_LANDING_PAGE_UNITY_DAYS         = "unity_days"
	GRAMMAR_INTENT_LANDING_PAGE_FRIENDS_GATHERINGS = "friends_gatherings"
	GRAMMAR_INTENT_LANDING_PAGE_MEALS              = "meals"
	GRAMMAR_INTENT_LANDING_PAGE_TOPICS             = "topics"
	GRAMMAR_INTENT_LANDING_PAGE_BLOG               = "blog"
	GRAMMAR_INTENT_LANDING_PAGE_TWITTER            = "twitter"
	GRAMMAR_INTENT_LANDING_PAGE_ARTICLES           = "articles"
	GRAMMAR_INTENT_LANDING_PAGE_DOWNLOADS          = "downloads"
	GRAMMAR_INTENT_LANDING_PAGE_HELP               = "help"
)
View Source
const (
	VAR_YEAR                = "$Year"
	VAR_CONVENTION_LOCATION = "$ConventionLocation"
	VAR_TEXT                = "$Text"
	VAR_HOLIDAYS            = "$Holidays"
	VAR_CONTENT_TYPE        = "$ContentType"
	VAR_SOURCE              = "$Source"
	VAR_POSITION            = "$Position"
	VAR_DIVISION_TYPE       = "$DivisionType"
	VAR_PROGRAM             = "$Program"
	VAR_RESTRICTED          = "$Restricted" // Search terms that privent triggering grammar engine.

	VAR_CT_PROGRAMS        = "programs"
	VAR_CT_ARTICLES        = "articles"
	VAR_CT_LESSONS         = "lessons"
	VAR_CT_CLIPS           = "clips"
	VAR_CT_SOURCES         = "sources"
	VAR_CT_BOOK_TITLES     = "books_titles"
	VAR_CT_MEALS           = "meals"
	VAR_CT_BLOG            = "blog"
	VAR_CT_VIRTUAL_LESSONS = "virtual_lessons"
	VAR_CT_WOMEN_LESSONS   = "women_lessons"

	VAR_DIV_ARTICLE = "article"
	VAR_DIV_CHAPTER = "chapter"
	VAR_DIV_VOLUME  = "volume"
	VAR_DIV_PART    = "part"
	VAR_DIV_NUMBER  = "number"
)
View Source
const (
	LAT_DOSEARCH                                = "DoSearch"
	LAT_DOSEARCH_MULTISEARCHDO                  = "DoSearch.MultisearchDo"
	LAT_DOSEARCH_MULTISEARCHHIGHLIGHTSDO        = "DoSearch.MultisearcHighlightsDo"
	LAT_DOSEARCH_ADDINTENTS                     = "DoSearch.AddIntents"
	LAT_DOSEARCH_ADDINTENTS_FIRSTROUNDDO        = "DoSearch.AddIntents.FirstRoundDo"
	LAT_DOSEARCH_ADDINTENTS_SECONDROUNDDO       = "DoSearch.AddIntents.SecondRoundDo"
	LAT_DOSEARCH_MULTISEARCHTWEETSDO            = "DoSearch.MultisearchTweetsDo"
	LAT_DOSEARCH_TYPOSUGGESTDO                  = "DoSearch.TypoSuggestDo"
	LAT_GETSUGGESTIONS                          = "GetSuggestions"
	LAT_SUGGEST_SUGGESTIONS                     = "GetSuggestions.SuggestSuggestions"
	LAT_GETSUGGESTIONS_MULTISEARCHDO            = "GetSuggestions.MultisearchDo"
	LAT_DOSEARCH_GRAMMARS_MULTISEARCHGRAMMARSDO = "DoSearch.SearchGrammars.MultisearchGrammarsDo"
	LAT_DOSEARCH_GRAMMARS_MULTISEARCHFILTERDO   = "DoSearch.SearchGrammars.MultisearchFilterDo"
	LAT_DOSEARCH_GRAMMARS_RESULTSTOINTENTS      = "DoSearch.SearchGrammars.ResultsToIntents"
)

Latency log

View Source
const (
	PROGRAM_COLLECTION_HAPITARON            = "MvD8Dk2S"
	PROGRAM_COLLECTION_NEW_LIFE             = "zf4lLwyI"
	PROGRAM_COLLECTION_WRITERS_MEETING      = "CwdCR0xR"
	PROGRAM_COLLECTION_EL_MUNDO             = "t9oGIcN5"
	PROGRAM_COLLECTION_NASHIM_BEOLAM_HADASH = "2v7UzleG"
	PROGRAM_COLLECTION_GLOBAL_PERSPECTIVES  = "n0xqPUd0"
	PROGRAM_COLLECTION_NEWS_IN_RUSSIAN      = "SmssHWWs"

	ARTICLE_COLLECTION_NEW_LIFE             = "suS7S4KN"
	ARTICLE_COLLECTION_WRITERS_MEETING      = "dHLMoKlp"
	ARTICLE_COLLECTION_EL_MUNDO             = "QjclHot5"
	ARTICLE_COLLECTION_NASHIM_BEOLAM_HADASH = "Rqd7RNhm"
	ARTICLE_COLLECTION_GLOBAL_PERSPECTIVES  = "1UDYTmy3"
	ARTICLE_COLLECTION_NEWS_IN_RUSSIAN      = "xW7rPwDd"
)
View Source
const (
	SRC_SHAMATI                               = "qMUUn22b"
	SRC_NONE_ELSE_BESIDE_HIM                  = "hFeGidcS"
	SRC_PEACE_ARCTICLE                        = "28Cmp7gl"
	SRC_PEACE_IN_WORLD_ARTICLE                = "hqUTKcZz"
	SRC_ARVUT_ARTICLE                         = "itcVAcFn"
	SRC_RABASH_ASSORTED_NOTES                 = "2GAdavz0"
	SRC_THE_ROSE_ARTICLE                      = "yUcfylRm"
	SRC_LETTERS_RABASH                        = "b8SHlrfH"
	SRC_ARTICLES_RABASH                       = "rQ6sIUZK"
	SRC_ARTICLES_BAAL_SULAM                   = "qMeV5M3Y"
	SRC_BAAL_SULAM_ARTICLES_LETTERS_SUMMARIES = "QUBP2DYe"
	SRC_BAAL_SULAM_WRITINGS_CAMPUS_RU         = "8Y0f8Jg9"
	SRC_CONNECTING_TO_THE_SOURCE              = "wWm6fbn4"
	SRC_ZOHAR_FOR_ALL_VOL_12                  = "oau8jvcD"
)
View Source
const CDN = "https://cdn.kabbalahmedia.info/"
View Source
const ES_RESULTS_INDEX = "results"

ElasticSearch 'es'

View Source
const ES_RESULT_TYPE = "result_type"

Result type

View Source
const ES_RESULT_TYPE_BLOG_POSTS = "posts"
View Source
const ES_RESULT_TYPE_COLLECTIONS = "collections"
View Source
const ES_RESULT_TYPE_SOURCES = "sources"
View Source
const ES_RESULT_TYPE_TAGS = "tags"
View Source
const ES_RESULT_TYPE_TWEETS = "tweets"
View Source
const ES_RESULT_TYPE_UNITS = "units"
View Source
const ES_UID_TYPE_BLOG_POST = "blog_post"
View Source
const ES_UID_TYPE_COLLECTION = "collection"
View Source
const ES_UID_TYPE_CONTENT_UNIT = "content_unit"

Typed UIDs and Filter

View Source
const ES_UID_TYPE_FILE = "file"
View Source
const ES_UID_TYPE_SOURCE = "source"
View Source
const ES_UID_TYPE_TAG = "tag"
View Source
const ES_UID_TYPE_TWEET = "tweet"
View Source
const SEARCH_RESULT_TWEETS_MANY = "tweets_many"

Result of many tweets in one hit

View Source
const TOKEN_CACHE_SIZE = 10000

TokensCache LRU cache size

Variables

View Source
var ANALYZERS = map[string]string{
	LANG_AMHARIC:    "standard",
	LANG_ARABIC:     "arabic",
	LANG_BULGARIAN:  "bulgarian",
	LANG_CZECH:      "czech",
	LANG_GERMAN:     "german",
	LANG_ENGLISH:    "english_synonym",
	LANG_SPANISH:    "spanish_synonym",
	LANG_PERSIAN:    "persian",
	LANG_FINNISH:    "finnish",
	LANG_FRENCH:     "french",
	LANG_HEBREW:     "hebrew_synonym",
	LANG_HINDI:      "hindi",
	LANG_CROATIAN:   "standard",
	LANG_HUNGARIAN:  "hungarian",
	LANG_ITALIAN:    "italian",
	LANG_JAPANESE:   "cjk",
	LANG_GEORGIAN:   "standard",
	LANG_LITHUANIAN: "lithuanian",
	LANG_LATVIAN:    "latvian",
	LANG_MACEDONIAN: "standard",
	LANG_DUTCH:      "dutch",
	LANG_NORWEGIAN:  "norwegian",
	LANG_POLISH:     "standard",
	LANG_PORTUGUESE: "portuguese",
	LANG_ROMANIAN:   "romanian",
	LANG_RUSSIAN:    "russian_synonym",
	LANG_SLOVAK:     "standard",
	LANG_SLOVENIAN:  "standard",
	LANG_SWEDISH:    "swedish",
	LANG_TURKISH:    "turkish",
	LANG_UKRAINIAN:  "standard",
	LANG_CHINESE:    "cjk",
}

If these filters present, we automatically add some search results when the search term is identical to source name.

View Source
var CODE2LANG = map[string]string{
	"ENG": LANG_ENGLISH,
	"HEB": LANG_HEBREW,
	"RUS": LANG_RUSSIAN,
	"SPA": LANG_SPANISH,
	"ITA": LANG_ITALIAN,
	"GER": LANG_GERMAN,
	"DUT": LANG_DUTCH,
	"FRE": LANG_FRENCH,
	"POR": LANG_PORTUGUESE,
	"TRK": LANG_TURKISH,
	"POL": LANG_POLISH,
	"ARB": LANG_ARABIC,
	"HUN": LANG_HUNGARIAN,
	"FIN": LANG_FINNISH,
	"LIT": LANG_LITHUANIAN,
	"JPN": LANG_JAPANESE,
	"BUL": LANG_BULGARIAN,
	"GEO": LANG_GEORGIAN,
	"NOR": LANG_NORWEGIAN,
	"SWE": LANG_SWEDISH,
	"HRV": LANG_CROATIAN,
	"CHN": LANG_CHINESE,
	"PER": LANG_PERSIAN,
	"RON": LANG_ROMANIAN,
	"HIN": LANG_HINDI,
	"UKR": LANG_UKRAINIAN,
	"MKD": LANG_MACEDONIAN,
	"SLV": LANG_SLOVENIAN,
	"LAV": LANG_LATVIAN,
	"SLK": LANG_SLOVAK,
	"CZE": LANG_CZECH,
	"AMH": LANG_AMHARIC,
}
View Source
var CT_VARIABLES_ENABLE_SOURCES_SEARCH = map[string]bool{
	VAR_CT_ARTICLES:    true,
	VAR_CT_SOURCES:     true,
	VAR_CT_BOOK_TITLES: true,
}

Grammar $ContentType variables to content type filters mapping.

View Source
var ES_GRAMMAR_PROGRAM_SUPPORTED_DIV_TYPES = map[string]bool{
	VAR_DIV_CHAPTER: true,
	VAR_DIV_NUMBER:  true,
}

ES_RESULT_TYPE_TWEETS is not part of the array since it's searched in parallel to other results search

We used to name this articles with the prefix word "maamar" (article). We will suggest the correct source result when the user types their name with the prefix "maamar".

View Source
var ES_SRC_PARENTS_FOR_CHAPTER_POSITION_INDEX = map[string]PositionIndexType{
	SRC_SHAMATI:               LETTER_IF_HEBREW,
	SRC_RABASH_ASSORTED_NOTES: ALWAYS_NUMBER,
}

Note: Suggest is not indexed anyway for rules with "free text" variables.

View Source
var FILTERS = map[string]string{
	FILTER_TAG:                       "tag",
	FILTER_START_DATE:                "start_date",
	FILTER_END_DATE:                  "end_date",
	FILTER_SOURCE:                    "source",
	FILTER_AUTHOR:                    "source",
	FILTER_UNITS_CONTENT_TYPES:       "content_type",
	FILTER_COLLECTIONS_CONTENT_TYPES: "collection_content_type",
	FILTER_SECTION_SOURCES:           "filter_section_sources",
	FILTER_LANGUAGE:                  "media_language",
	FILTER_COLLECTION:                "collection",
}

Use to identify and map request filters Maps frontend filter name to backend filter name which is index field name. Query will have backend filter names.

View Source
var GRAMMAR_INTENTS_TO_FILTER_VALUES = map[string]map[string][]string{

	GRAMMAR_INTENT_LANDING_PAGE_LESSONS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_LESSON_PART, CT_FULL_LESSON},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_DAILY_LESSON},
	},
	GRAMMAR_INTENT_LANDING_PAGE_VIRTUAL_LESSONS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_VIRTUAL_LESSON},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_VIRTUAL_LESSONS},
	},
	GRAMMAR_INTENT_LANDING_PAGE_LECTURES: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_LECTURE},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_LECTURE_SERIES},
	},
	GRAMMAR_INTENT_LANDING_PAGE_WOMEN_LESSONS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_WOMEN_LESSON},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_WOMEN_LESSONS},
	},
	GRAMMAR_INTENT_LANDING_PAGE_RABASH_LESSONS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_LESSON_PART},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_DAILY_LESSON},
	},
	GRAMMAR_INTENT_LANDING_PAGE_LESSON_SERIES: map[string][]string{
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_LESSONS_SERIES},
	},
	GRAMMAR_INTENT_LANDING_PAGE_PRORGRAMS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_VIDEO_PROGRAM_CHAPTER},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_VIDEO_PROGRAM},
	},
	GRAMMAR_INTENT_LANDING_PAGE_CLIPS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]: []string{CT_CLIP},
	},
	GRAMMAR_INTENT_LANDING_PAGE_LIBRARY: map[string][]string{
		FILTERS[FILTER_SECTION_SOURCES]: []string{""},
	},
	GRAMMAR_INTENT_LANDING_PAGE_GROUP_ARTICLES: map[string][]string{
		FILTERS[FILTER_SECTION_SOURCES]: []string{""},
	},
	GRAMMAR_INTENT_LANDING_PAGE_CONVENTIONS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_EVENT_PART},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_CONGRESS},
	},
	GRAMMAR_INTENT_LANDING_PAGE_HOLIDAYS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_EVENT_PART},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_HOLIDAY},
	},
	GRAMMAR_INTENT_LANDING_PAGE_UNITY_DAYS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_EVENT_PART},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_UNITY_DAY},
	},
	GRAMMAR_INTENT_LANDING_PAGE_FRIENDS_GATHERINGS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_FRIENDS_GATHERING},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_FRIENDS_GATHERINGS},
	},
	GRAMMAR_INTENT_LANDING_PAGE_MEALS: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_MEAL},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_MEALS},
	},
	GRAMMAR_INTENT_LANDING_PAGE_TOPICS: nil,
	GRAMMAR_INTENT_LANDING_PAGE_BLOG: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_BLOG_POST, SCT_BLOG_POST},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_ARTICLES},
	},
	GRAMMAR_INTENT_LANDING_PAGE_TWITTER: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{SCT_TWEET},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_ARTICLES},
	},
	GRAMMAR_INTENT_LANDING_PAGE_ARTICLES: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_ARTICLE, CT_PUBLICATION},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_ARTICLES},
	},
	GRAMMAR_INTENT_LANDING_PAGE_DOWNLOADS: nil,
	GRAMMAR_INTENT_LANDING_PAGE_HELP:      nil,

	GRAMMAR_INTENT_SOURCE_POSITION_WITHOUT_TERM: map[string][]string{
		FILTERS[FILTER_SECTION_SOURCES]:           []string{""},
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_LESSON_PART, CT_FULL_LESSON, CT_VIDEO_PROGRAM_CHAPTER},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_DAILY_LESSON, CT_VIDEO_PROGRAM},
	},

	GRAMMAR_INTENT_PROGRAM_POSITION_WITHOUT_TERM: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_VIDEO_PROGRAM_CHAPTER},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_VIDEO_PROGRAM},
	},

	GRAMMAR_INTENT_FILTER_BY_CONTENT_TYPE: nil,

	GRAMMAR_INTENT_FILTER_BY_SOURCE: map[string][]string{
		FILTERS[FILTER_SECTION_SOURCES]: []string{""},
		FILTERS[FILTER_UNITS_CONTENT_TYPES]: []string{CT_LESSON_PART, CT_FULL_LESSON, CT_VIDEO_PROGRAM_CHAPTER, CT_VIRTUAL_LESSON, CT_LECTURE,
			CT_WOMEN_LESSON, CT_EVENT_PART, CT_FRIENDS_GATHERING, CT_MEAL},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_DAILY_LESSON, CT_VIDEO_PROGRAM, CT_VIRTUAL_LESSONS, CT_LECTURE_SERIES, CT_LECTURE_SERIES,
			CT_CONGRESS, CT_HOLIDAY, CT_UNITY_DAY, CT_FRIENDS_GATHERINGS, CT_MEALS},
	},

	GRAMMAR_INTENT_FILTER_BY_PROGRAM: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_VIDEO_PROGRAM_CHAPTER},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_VIDEO_PROGRAM},
	},

	GRAMMAR_INTENT_FILTER_BY_PROGRAM_WITHOUT_TERM: map[string][]string{
		FILTERS[FILTER_UNITS_CONTENT_TYPES]:       []string{CT_VIDEO_PROGRAM_CHAPTER},
		FILTERS[FILTER_COLLECTIONS_CONTENT_TYPES]: []string{CT_VIDEO_PROGRAM},
	},
}

Map from intent to filters, i.e., filter name to list of values.

View Source
var I18N_LANG_ORDER = map[string][]string{
	"":              {LANG_ENGLISH},
	LANG_ENGLISH:    {LANG_ENGLISH},
	LANG_HEBREW:     {LANG_HEBREW, LANG_ENGLISH},
	LANG_RUSSIAN:    {LANG_RUSSIAN, LANG_ENGLISH},
	LANG_SPANISH:    {LANG_SPANISH, LANG_ENGLISH},
	LANG_ITALIAN:    {LANG_ITALIAN, LANG_ENGLISH},
	LANG_GERMAN:     {LANG_GERMAN, LANG_ENGLISH},
	LANG_DUTCH:      {LANG_DUTCH, LANG_ENGLISH},
	LANG_FRENCH:     {LANG_FRENCH, LANG_ENGLISH},
	LANG_PORTUGUESE: {LANG_PORTUGUESE, LANG_ENGLISH},
	LANG_TURKISH:    {LANG_TURKISH, LANG_ENGLISH},
	LANG_POLISH:     {LANG_POLISH, LANG_ENGLISH},
	LANG_ARABIC:     {LANG_ARABIC, LANG_ENGLISH},
	LANG_HUNGARIAN:  {LANG_HUNGARIAN, LANG_ENGLISH},
	LANG_FINNISH:    {LANG_FINNISH, LANG_ENGLISH},
	LANG_LITHUANIAN: {LANG_LITHUANIAN, LANG_RUSSIAN, LANG_ENGLISH},
	LANG_JAPANESE:   {LANG_JAPANESE, LANG_ENGLISH},
	LANG_BULGARIAN:  {LANG_BULGARIAN, LANG_ENGLISH},
	LANG_GEORGIAN:   {LANG_GEORGIAN, LANG_RUSSIAN, LANG_ENGLISH},
	LANG_NORWEGIAN:  {LANG_NORWEGIAN, LANG_ENGLISH},
	LANG_SWEDISH:    {LANG_SWEDISH, LANG_ENGLISH},
	LANG_CROATIAN:   {LANG_CROATIAN, LANG_ENGLISH},
	LANG_CHINESE:    {LANG_CHINESE, LANG_ENGLISH},
	LANG_PERSIAN:    {LANG_PERSIAN, LANG_ENGLISH},
	LANG_ROMANIAN:   {LANG_ROMANIAN, LANG_ENGLISH},
	LANG_HINDI:      {LANG_HINDI, LANG_ENGLISH},
	LANG_UKRAINIAN:  {LANG_UKRAINIAN, LANG_RUSSIAN, LANG_ENGLISH},
	LANG_MACEDONIAN: {LANG_MACEDONIAN, LANG_ENGLISH},
	LANG_SLOVENIAN:  {LANG_SLOVENIAN, LANG_ENGLISH},
	LANG_LATVIAN:    {LANG_LATVIAN, LANG_ENGLISH},
	LANG_SLOVAK:     {LANG_SLOVAK, LANG_ENGLISH},
	LANG_CZECH:      {LANG_CZECH, LANG_ENGLISH},
	LANG_AMHARIC:    {LANG_AMHARIC, LANG_ENGLISH},
}

Fake index for intents.

View Source
var INTENT_OPTIONS_BY_GRAMMAR_CT_VARIABLES = map[string]IntentSearchOptions{
	VAR_CT_PROGRAMS: IntentSearchOptions{
		SearchSources: true,
		SearchTags:    true,
		ContentTypes:  []string{CT_VIDEO_PROGRAM_CHAPTER},
	},
	VAR_CT_ARTICLES: IntentSearchOptions{
		SearchSources: true,
		SearchTags:    false,
		ContentTypes:  []string{CT_VIDEO_PROGRAM_CHAPTER, CT_LESSON_PART},
	},
	VAR_CT_LESSONS: IntentSearchOptions{
		SearchSources: true,
		SearchTags:    true,
		ContentTypes:  []string{CT_LESSON_PART},
	},
	VAR_CT_BOOK_TITLES: IntentSearchOptions{
		SearchSources: true,
		SearchTags:    false,
		ContentTypes:  []string{CT_VIDEO_PROGRAM_CHAPTER, CT_LESSON_PART},
	},
}
View Source
var LANG2CODE = map[string]string{
	LANG_ENGLISH:    "ENG",
	LANG_HEBREW:     "HEB",
	LANG_RUSSIAN:    "RUS",
	LANG_SPANISH:    "SPA",
	LANG_ITALIAN:    "ITA",
	LANG_GERMAN:     "GER",
	LANG_DUTCH:      "DUT",
	LANG_FRENCH:     "FRE",
	LANG_PORTUGUESE: "POR",
	LANG_TURKISH:    "TRK",
	LANG_POLISH:     "POL",
	LANG_ARABIC:     "ARB",
	LANG_HUNGARIAN:  "HUN",
	LANG_FINNISH:    "FIN",
	LANG_LITHUANIAN: "LIT",
	LANG_JAPANESE:   "JPN",
	LANG_BULGARIAN:  "BUL",
	LANG_GEORGIAN:   "GEO",
	LANG_NORWEGIAN:  "NOR",
	LANG_SWEDISH:    "SWE",
	LANG_CROATIAN:   "HRV",
	LANG_CHINESE:    "CHN",
	LANG_PERSIAN:    "PER",
	LANG_ROMANIAN:   "RON",
	LANG_HINDI:      "HIN",
	LANG_UKRAINIAN:  "UKR",
	LANG_MACEDONIAN: "MKD",
	LANG_SLOVENIAN:  "SLV",
	LANG_LATVIAN:    "LAV",
	LANG_SLOVAK:     "SLK",
	LANG_CZECH:      "CZE",
	LANG_AMHARIC:    "AMH",
}
View Source
var NOT_TO_INCLUDE_IN_SOURCE_BY_POSITION = []string{
	SRC_LETTERS_RABASH, SRC_ARTICLES_RABASH, SRC_ARTICLES_BAAL_SULAM,
}
View Source
var SEARCH_LANG_ORDER = map[string][]string{
	"":           {LANG_ENGLISH},
	LANG_ENGLISH: {LANG_ENGLISH},
	LANG_HEBREW:  {LANG_HEBREW, LANG_ENGLISH},
	LANG_RUSSIAN: {LANG_RUSSIAN, LANG_ENGLISH},

	LANG_SPANISH:    {LANG_ENGLISH, LANG_SPANISH},
	LANG_ITALIAN:    {LANG_ENGLISH, LANG_ITALIAN},
	LANG_GERMAN:     {LANG_ENGLISH, LANG_GERMAN},
	LANG_DUTCH:      {LANG_ENGLISH, LANG_DUTCH},
	LANG_FRENCH:     {LANG_ENGLISH, LANG_FRENCH},
	LANG_PORTUGUESE: {LANG_ENGLISH, LANG_PORTUGUESE},
	LANG_TURKISH:    {LANG_ENGLISH, LANG_TURKISH},
	LANG_POLISH:     {LANG_ENGLISH, LANG_POLISH},
	LANG_ARABIC:     {LANG_ENGLISH, LANG_ARABIC},
	LANG_HUNGARIAN:  {LANG_ENGLISH, LANG_HUNGARIAN},
	LANG_FINNISH:    {LANG_ENGLISH, LANG_FINNISH},
	LANG_LITHUANIAN: {LANG_ENGLISH, LANG_LITHUANIAN},
	LANG_JAPANESE:   {LANG_ENGLISH, LANG_JAPANESE},

	LANG_BULGARIAN: {LANG_RUSSIAN, LANG_BULGARIAN, LANG_ENGLISH},
	LANG_GEORGIAN:  {LANG_ENGLISH, LANG_GEORGIAN},
	LANG_NORWEGIAN: {LANG_ENGLISH, LANG_NORWEGIAN},
	LANG_SWEDISH:   {LANG_ENGLISH, LANG_SWEDISH},
	LANG_CROATIAN:  {LANG_ENGLISH, LANG_CROATIAN},
	LANG_CHINESE:   {LANG_ENGLISH, LANG_CHINESE},
	LANG_PERSIAN:   {LANG_ENGLISH, LANG_PERSIAN},
	LANG_ROMANIAN:  {LANG_ENGLISH, LANG_ROMANIAN},
	LANG_HINDI:     {LANG_ENGLISH, LANG_HINDI},

	LANG_UKRAINIAN: {LANG_RUSSIAN, LANG_UKRAINIAN, LANG_ENGLISH},

	LANG_MACEDONIAN: {LANG_RUSSIAN, LANG_MACEDONIAN, LANG_ENGLISH},
	LANG_SLOVENIAN:  {LANG_ENGLISH, LANG_SLOVENIAN},
	LANG_LATVIAN:    {LANG_ENGLISH, LANG_LATVIAN},
	LANG_SLOVAK:     {LANG_ENGLISH, LANG_SLOVAK},
	LANG_CZECH:      {LANG_ENGLISH, LANG_CZECH},
	LANG_AMHARIC:    {LANG_ENGLISH, LANG_AMHARIC},
}

Source names that we avoid adding: 1. Zohar For All vol.12 chapter names (that are actually general topic names). 2. Source names from Rabash Assorted notes because many of them are similar to concepts or topics and less known as names of Rabash sources. 3. Article summaries and campus material to avoid confusion with the original sources.

View Source
var SRC_TYPES_FOR_TITLE_DESCRIPTION_CONCAT = map[int64]bool{
	SRC_TYPE_VOLUME: true,
	SRC_TYPE_PART:   true,
}
View Source
var VARIABLE_TO_FILTER = map[string]string{
	VAR_YEAR:                "year",
	VAR_CONVENTION_LOCATION: "location",
	VAR_TEXT:                "text",
	VAR_HOLIDAYS:            "holidays",
	VAR_CONTENT_TYPE:        "content_type",
	VAR_SOURCE:              "source",
	VAR_POSITION:            "position",
	VAR_PROGRAM:             "program",
}

Variable name to frontend filter name mapping.

Functions

This section is empty.

Types

type IntentSearchOptions added in v1.10.3

type IntentSearchOptions struct {
	SearchTags    bool
	SearchSources bool
	ContentTypes  []string
}

type PositionIndexType added in v1.9.0

type PositionIndexType int
const (
	ALWAYS_NUMBER    PositionIndexType = iota
	LETTER_IF_HEBREW PositionIndexType = iota
)

type SearchFilterType added in v0.9.5

type SearchFilterType int

Search filter.

const (
	SEARCH_NO_FILTER              SearchFilterType = iota
	SEARCH_FILTER_ONLY_SOURCES    SearchFilterType = iota
	SEARCH_FILTER_WITHOUT_SOURCES SearchFilterType = iota
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL