Skip to content

Commit

Permalink
Fixes to topic search
Browse files Browse the repository at this point in the history
  • Loading branch information
richmahn committed Jan 1, 2025
1 parent 7615705 commit 8bf0019
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions routers/web/dcs/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func RenderCatalogSearch(ctx *context.Context, opts *CatalogSearchOptions) {
}

query := ctx.FormTrim("q")
searchFields := []string{"keyword", "book", "lang", "subject", "flavor_type", "flavor", "abbreviation", "content_format", "repo", "owner", "tag", "checking_level", "metadata_type", "metadata_version", "topic", "topic_inverted", "healthcheck", "stage"}
searchFields := []string{"keyword", "book", "lang", "subject", "flavor_type", "flavor", "abbreviation", "content_format", "repo", "owner", "tag", "checking_level", "metadata_type", "metadata_version", "topic", "without_topic", "stage"}
searchMap := map[string][]string{}
for _, field := range searchFields {
searchMap[field] = []string{}
Expand Down Expand Up @@ -146,7 +146,7 @@ func RenderCatalogSearch(ctx *context.Context, opts *CatalogSearchOptions) {
MetadataTypes: searchMap["metadata_type"],
MetadataVersions: searchMap["metadata_version"],
Topics: searchMap["topic"],
InvertedTopics: searchMap["topic_inverted"],
InvertedTopics: searchMap["without_topic"],
Tags: searchMap["tag"],
CheckingLevels: searchMap["checking_level"],
})
Expand Down
4 changes: 2 additions & 2 deletions routers/web/explore/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {

/*** DCS Customizations ***/
origKeyword := keyword
searchFields := []string{"keyword", "book", "lang", "subject", "flavor_type", "flavor", "abbreviation", "content_format", "repo", "owner", "tag", "checking_level", "metadata_type", "metadata_version", "topic", "topic_inverted", "healthcheck", "stage"}
searchFields := []string{"keyword", "book", "lang", "subject", "flavor_type", "flavor", "abbreviation", "content_format", "repo", "owner", "tag", "checking_level", "metadata_type", "metadata_version", "topic", "without_topic", "healthcheck", "stage"}
searchMap := map[string][]string{}
for _, field := range searchFields {
searchMap[field] = []string{}
Expand Down Expand Up @@ -157,7 +157,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
MetadataTypes: searchMap["metadata_type"], // DCS Customizations
MetadataVersions: searchMap["metadata_version"], // DCS Customizations
Topics: searchMap["topic"], // DCS Customizations
InvertedTopics: searchMap["topic_inverted"], // DCS Customizations
InvertedTopics: searchMap["without_topic"], // DCS Customizations
Healthchecks: searchMap["healthcheck"], // DCS Customizations
OnlyShowRelevant: opts.OnlyShowRelevant,
})
Expand Down
2 changes: 1 addition & 1 deletion templates/shared/searchbuilder.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
{ name: 'query', tooltip: 'queries repo name, owner, description & topics. Allows partial match' },
{ name: 'lang', tooltip: 'language code, e.g. en, fr' },
{ name: 'topic', tooltip: 'the topic of a repo, e.g. tc-ready' },
{ name: 'topic_inverted', tooltip: 'show entries that do NOT have this topic' },
{ name: 'without_topic', tooltip: 'show entries that do NOT have this topic' },
{ name: 'subject', tooltip: 'type of resource, e.g. Aligned Bible, Open Bibles Stories', options: ["Aligned Bible", "Aramaic Grammar", "Bible", "Greek Grammar", "Greek Lexicon", "Greek New Testament", "Hebrew Grammar", "Hebrew Old Testament", "Hebrew-Aramaic Lexicon", "OBS Study Notes", "OBS Study Questions", "OBS Translation Notes", "OBS Translation Questions", "Open Bible Stories", "Study Notes", "Study Questions", "Training Library", "Translation Academy", "Translation Notes", "Translation Questions", "Translation Words", "TSV Study Notes", "TSV Study Questions", "TSV Translation Notes", "TSV Translation Questions", "TSV Translation Words Links", "TSV OBS Study Notes", "TSV OBS Study Questions", "TSV OBS Translation Notes", "TSV OBS Translation Questions", "TSV OBS Translation Words Links"] },
{ name: 'owner', tooltip: 'user or organization, e.g. unfoldingWord' },
{ name: 'repo', tooltip: 'repository name, e.g. en_ult' },
Expand Down

0 comments on commit 8bf0019

Please sign in to comment.