Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/ttab/langos v0.1.1
github.com/ttab/mage v0.9.0
github.com/ttab/newsdoc v1.0.0
github.com/ttab/revisor v0.10.0
github.com/ttab/revisor v0.11.1
github.com/ttab/revisorschemas v1.2.0-pre6
github.com/twitchtv/twirp v8.1.3+incompatible
github.com/urfave/cli/v3 v3.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ github.com/ttab/mage v0.9.0 h1:zNd1aM0kvuYAPy59BqSW+5rGkEzMLp3PMYE2HL+AhAI=
github.com/ttab/mage v0.9.0/go.mod h1:nemmtRhMVzb/DRo+stFa6BaQwLatMFmmZ9d8XmGgd6U=
github.com/ttab/newsdoc v1.0.0 h1:ftGbUkReu+teOGuh00eZgeSraghzyMaMEJQ0acrFYDw=
github.com/ttab/newsdoc v1.0.0/go.mod h1:Lt4bBWEsP3b5ChLwzuQ4fvxcfnv2u5DwrV9ADmE5ViQ=
github.com/ttab/revisor v0.10.0 h1:gpgKFWeQCAnl/IOHrIgm3wVWx2O+ZZF6/0nXghLfHTs=
github.com/ttab/revisor v0.10.0/go.mod h1:By0/kKtwwl1HgAqgz6NCsZPuoXhJyf1GmuXlC5YpTRo=
github.com/ttab/revisor v0.11.1 h1:z7TNd4OFyUUuwxiHhe/bBJQSTajf2Ysn8OTpFAfQORI=
github.com/ttab/revisor v0.11.1/go.mod h1:By0/kKtwwl1HgAqgz6NCsZPuoXhJyf1GmuXlC5YpTRo=
github.com/ttab/revisorschemas v1.2.0-pre6 h1:m8UkjOMZKd891T7KEjhP5hwiaUiloa9r1xsDdMGxHis=
github.com/ttab/revisorschemas v1.2.0-pre6/go.mod h1:tHSBsIBjsbhbi3304hloDNpEJVGRLS+b7T5V0ok+IyY=
github.com/twitchtv/twirp v8.1.3+incompatible h1:+F4TdErPgSUbMZMwp13Q/KgDVuI7HJXP61mNV3/7iuU=
Expand Down
2 changes: 1 addition & 1 deletion index/language-settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestGetLanguageSetting(t *testing.T) {

idx := index.NewIndexName(
index.IndexTypeDocuments,
"happy-hog", "core/article+template", lang)
"happy-hog", "core/article#template", lang)

test.Equal(t, "core_article--template-sv-se", idx.Language,
"variant type language name")
Expand Down
2 changes: 1 addition & 1 deletion index/search_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestIndexPattern(t *testing.T) {
"index pattern with text and language and region")
test.Equal(t, "documents-foo-core_article--template-*",
internal.IndexPattern("foo", &index.QueryRequestV1{
DocumentType: "core/article+template",
DocumentType: "core/article#template",
}),
"index pattern with variant type")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/searchrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const (
var NonAlphaNum = regexp.MustCompile(`[^a-zA-Z0-9 ]+`)

// SanitizeDocType converts a document type name into a string safe for use in
// index names. The "+" variant separator is replaced with "--" to avoid
// index names. The "#" variant separator is replaced with "--" to avoid
// collisions with the "_" used for other non-alphanumeric characters.
func SanitizeDocType(docType string) string {
base, variant, hasVariant := strings.Cut(docType, "+")
base, variant, hasVariant := strings.Cut(docType, "#")
sanitized := NonAlphaNum.ReplaceAllString(base, "_")

if hasVariant {
Expand Down