Skip to content

Commit

Permalink
Added dot(.) as a valid in an attribute name for the deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
flindskog authored and aallam committed Oct 5, 2020
1 parent c8d12e2 commit 9703d3a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/main/scala/algolia/AlgoliaDsl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ object AlgoliaDsl extends AlgoliaDsl {
new ZonedDateTimeSerializer +
new AlternativesSerializer

val searchableAttributesUnordered: Regex = """^unordered\(([\w-]+)\)$""".r
val searchableAttributesUnordered: Regex = """^unordered\(([\w-\\.]+)\)$""".r
val searchableAttributesAttributes: Regex =
"""^([\w-]+,[\w-]+[,[\w-]+]*)$""".r
"""^([\w-\\.]+,[\w-\\.]+[,[\w-\\.]+]*)$""".r
val numericAttributesToIndexEqualOnly: Regex =
"""^equalOnly\(([\w-]+)\)$""".r
val asc: Regex = """^asc\(([\w-]+)\)$""".r
val desc: Regex = """^desc\(([\w-]+)\)$""".r
"""^equalOnly\(([\w-\\.]+)\)$""".r
val asc: Regex = """^asc\(([\w-\\.]+)\)$""".r
val desc: Regex = """^desc\(([\w-\\.]+)\)$""".r

sealed trait ForwardToReplicas

Expand Down
9 changes: 6 additions & 3 deletions src/test/scala/algolia/dsl/IndexSettingsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ class IndexSettingsTest extends AlgoliaTest {
| ],
| "customRanking":[
| "asc(att8)",
| "desc(att9)"
| "desc(att9)",
| "desc(nested.att10)"
| ],
| "typoTolerance":"strict",
| "ignorePlurals":"fr,en"
Expand Down Expand Up @@ -169,7 +170,8 @@ class IndexSettingsTest extends AlgoliaTest {
Some(
Seq(
CustomRanking.asc("att8"),
CustomRanking.desc("att9")
CustomRanking.desc("att9"),
CustomRanking.desc("nested.att10")
)
)
)
Expand Down Expand Up @@ -221,7 +223,8 @@ class IndexSettingsTest extends AlgoliaTest {
customRanking = Some(
Seq(
CustomRanking.asc("att8"),
CustomRanking.desc("att9")
CustomRanking.desc("att9"),
CustomRanking.desc("nested.att10")
)
),
ignorePlurals = Some(IgnorePlurals.list(Seq("fr", "en"))),
Expand Down

0 comments on commit 9703d3a

Please sign in to comment.