Skip to content

Commit cc048b0

Browse files
authored
fix(result): make fields optional (#635)
1 parent ad4ddf2 commit cc048b0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/main/scala/algolia/responses/BrowseResult.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import org.json4s.{DefaultFormats, JObject}
3030
case class BrowseResult(
3131
cursor: Option[String],
3232
hits: Seq[JObject],
33-
processingTimeMS: Int,
34-
query: String,
35-
params: String,
33+
processingTimeMS: Option[Int],
34+
query: Option[String],
35+
params: Option[String],
3636
nbHits: Option[Int],
3737
page: Option[Int],
3838
histPerPage: Option[Int],

src/main/scala/algolia/responses/SearchFacetResult.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ package algolia.responses
2727

2828
case class SearchFacetResult(
2929
facetHits: List[FacetHit],
30-
exhaustiveFacetsCount: Boolean,
31-
processingTimeMS: Int
30+
exhaustiveFacetsCount: Option[Boolean],
31+
processingTimeMS: Option[Int]
3232
)
3333

3434
case class FacetHit(value: String, highlighted: String, count: Int)

src/main/scala/algolia/responses/SearchResult.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ private[algolia] trait SearchHits[A] {
3434

3535
case class SearchResult(
3636
hits: Seq[JObject],
37-
nbHits: Int,
38-
processingTimeMS: Int,
37+
nbHits: Option[Int],
38+
processingTimeMS: Option[Int] = None,
3939
hitsPerPage: Option[Int],
4040
page: Option[Int],
4141
nbPages: Option[Int],
@@ -44,9 +44,9 @@ case class SearchResult(
4444
facets: Option[Map[String, Map[String, Int]]],
4545
exhaustiveFacetsCount: Option[Boolean],
4646
exhaustiveNbHits: Option[Boolean],
47-
query: String,
47+
query: Option[String],
4848
queryAfterRemoval: Option[String],
49-
params: String,
49+
params: Option[String],
5050
message: Option[String],
5151
aroundLatLng: Option[String],
5252
automaticRadius: Option[String],

0 commit comments

Comments
 (0)