@@ -92,27 +92,27 @@ public class SearchResultsItem<T> {
9292 @ JsonProperty ("_automaticInsights" )
9393 private Boolean automaticInsights ;
9494
95- @ JsonProperty ("page" )
96- private Integer page ;
95+ @ JsonProperty ("hits" )
96+ private List <T > hits = new ArrayList <>();
97+
98+ @ JsonProperty ("hitsPerPage" )
99+ private Integer hitsPerPage ;
97100
98101 @ JsonProperty ("nbHits" )
99102 private Integer nbHits ;
100103
101104 @ JsonProperty ("nbPages" )
102105 private Integer nbPages ;
103106
104- @ JsonProperty ("hitsPerPage " )
105- private Integer hitsPerPage ;
107+ @ JsonProperty ("page " )
108+ private Integer page ;
106109
107- @ JsonProperty ("hits " )
108- private List < T > hits = new ArrayList <>() ;
110+ @ JsonProperty ("params " )
111+ private String params ;
109112
110113 @ JsonProperty ("query" )
111114 private String query ;
112115
113- @ JsonProperty ("params" )
114- private String params ;
115-
116116 @ JsonProperty ("compositions" )
117117 private Map <String , ResultsCompositionInfoResponse > compositions = new HashMap <>();
118118
@@ -461,15 +461,34 @@ public Boolean getAutomaticInsights() {
461461 return automaticInsights ;
462462 }
463463
464- public SearchResultsItem <T > setPage ( Integer page ) {
465- this .page = page ;
464+ public SearchResultsItem <T > setHits ( List < T > hits ) {
465+ this .hits = hits ;
466466 return this ;
467467 }
468468
469- /** The current page of the results. */
469+ public SearchResultsItem <T > addHits (T hitsItem ) {
470+ this .hits .add (hitsItem );
471+ return this ;
472+ }
473+
474+ /**
475+ * Search results (hits). Hits are records from your index that match the search criteria,
476+ * augmented with additional attributes, such as, for highlighting.
477+ */
470478 @ javax .annotation .Nonnull
471- public Integer getPage () {
472- return page ;
479+ public List <T > getHits () {
480+ return hits ;
481+ }
482+
483+ public SearchResultsItem <T > setHitsPerPage (Integer hitsPerPage ) {
484+ this .hitsPerPage = hitsPerPage ;
485+ return this ;
486+ }
487+
488+ /** Number of hits returned per page. */
489+ @ javax .annotation .Nonnull
490+ public Integer getHitsPerPage () {
491+ return hitsPerPage ;
473492 }
474493
475494 public SearchResultsItem <T > setNbHits (Integer nbHits ) {
@@ -494,34 +513,26 @@ public Integer getNbPages() {
494513 return nbPages ;
495514 }
496515
497- public SearchResultsItem <T > setHitsPerPage (Integer hitsPerPage ) {
498- this .hitsPerPage = hitsPerPage ;
516+ public SearchResultsItem <T > setPage (Integer page ) {
517+ this .page = page ;
499518 return this ;
500519 }
501520
502- /** Number of hits returned per page . */
521+ /** The current page of the results . */
503522 @ javax .annotation .Nonnull
504- public Integer getHitsPerPage () {
505- return hitsPerPage ;
506- }
507-
508- public SearchResultsItem <T > setHits (List <T > hits ) {
509- this .hits = hits ;
510- return this ;
523+ public Integer getPage () {
524+ return page ;
511525 }
512526
513- public SearchResultsItem <T > addHits ( T hitsItem ) {
514- this .hits . add ( hitsItem ) ;
527+ public SearchResultsItem <T > setParams ( String params ) {
528+ this .params = params ;
515529 return this ;
516530 }
517531
518- /**
519- * Search results (hits). Hits are records from your index that match the search criteria,
520- * augmented with additional attributes, such as, for highlighting.
521- */
532+ /** URL-encoded string of all search parameters. */
522533 @ javax .annotation .Nonnull
523- public List < T > getHits () {
524- return hits ;
534+ public String getParams () {
535+ return params ;
525536 }
526537
527538 public SearchResultsItem <T > setQuery (String query ) {
@@ -535,17 +546,6 @@ public String getQuery() {
535546 return query ;
536547 }
537548
538- public SearchResultsItem <T > setParams (String params ) {
539- this .params = params ;
540- return this ;
541- }
542-
543- /** URL-encoded string of all search parameters. */
544- @ javax .annotation .Nonnull
545- public String getParams () {
546- return params ;
547- }
548-
549549 public SearchResultsItem <T > setCompositions (Map <String , ResultsCompositionInfoResponse > compositions ) {
550550 this .compositions = compositions ;
551551 return this ;
@@ -598,13 +598,13 @@ public boolean equals(Object o) {
598598 Objects .equals (this .userData , searchResultsItem .userData ) &&
599599 Objects .equals (this .queryID , searchResultsItem .queryID ) &&
600600 Objects .equals (this .automaticInsights , searchResultsItem .automaticInsights ) &&
601- Objects .equals (this .page , searchResultsItem .page ) &&
601+ Objects .equals (this .hits , searchResultsItem .hits ) &&
602+ Objects .equals (this .hitsPerPage , searchResultsItem .hitsPerPage ) &&
602603 Objects .equals (this .nbHits , searchResultsItem .nbHits ) &&
603604 Objects .equals (this .nbPages , searchResultsItem .nbPages ) &&
604- Objects .equals (this .hitsPerPage , searchResultsItem .hitsPerPage ) &&
605- Objects .equals (this .hits , searchResultsItem .hits ) &&
606- Objects .equals (this .query , searchResultsItem .query ) &&
605+ Objects .equals (this .page , searchResultsItem .page ) &&
607606 Objects .equals (this .params , searchResultsItem .params ) &&
607+ Objects .equals (this .query , searchResultsItem .query ) &&
608608 Objects .equals (this .compositions , searchResultsItem .compositions )
609609 );
610610 }
@@ -638,13 +638,13 @@ public int hashCode() {
638638 userData ,
639639 queryID ,
640640 automaticInsights ,
641- page ,
641+ hits ,
642+ hitsPerPage ,
642643 nbHits ,
643644 nbPages ,
644- hitsPerPage ,
645- hits ,
646- query ,
645+ page ,
647646 params ,
647+ query ,
648648 compositions
649649 );
650650 }
@@ -679,13 +679,13 @@ public String toString() {
679679 sb .append (" userData: " ).append (toIndentedString (userData )).append ("\n " );
680680 sb .append (" queryID: " ).append (toIndentedString (queryID )).append ("\n " );
681681 sb .append (" automaticInsights: " ).append (toIndentedString (automaticInsights )).append ("\n " );
682- sb .append (" page: " ).append (toIndentedString (page )).append ("\n " );
682+ sb .append (" hits: " ).append (toIndentedString (hits )).append ("\n " );
683+ sb .append (" hitsPerPage: " ).append (toIndentedString (hitsPerPage )).append ("\n " );
683684 sb .append (" nbHits: " ).append (toIndentedString (nbHits )).append ("\n " );
684685 sb .append (" nbPages: " ).append (toIndentedString (nbPages )).append ("\n " );
685- sb .append (" hitsPerPage: " ).append (toIndentedString (hitsPerPage )).append ("\n " );
686- sb .append (" hits: " ).append (toIndentedString (hits )).append ("\n " );
687- sb .append (" query: " ).append (toIndentedString (query )).append ("\n " );
686+ sb .append (" page: " ).append (toIndentedString (page )).append ("\n " );
688687 sb .append (" params: " ).append (toIndentedString (params )).append ("\n " );
688+ sb .append (" query: " ).append (toIndentedString (query )).append ("\n " );
689689 sb .append (" compositions: " ).append (toIndentedString (compositions )).append ("\n " );
690690 sb .append ("}" );
691691 return sb .toString ();
0 commit comments