code: protected void addHits(@Nullable SearchResults results, boolean isReplacing) {
          if (results == null) {
              if (isReplacing) {
                  clear();
                  if (infiniteScrollListener != null) {
                      infiniteScrollListener.setCurrentlyLoading(false);
                  }
              }
              return;
          }
  
          JSONArray hits = results.hits;
  
          if (isReplacing) {
              adapter.clear(false);
          }
  
          for (int i = 0; i < hits.length(); ++i) {
              JSONObject hit = hits.optJSONObject(i);
              if (hit != null) {
                  adapter.add(hit);
              }
          }
  
          if (isReplacing) {
              adapter.notifyDataSetChanged();
              smoothScrollToPosition(0);
              if (infiniteScrollListener != null) {
                  infiniteScrollListener.setCurrentlyLoading(false);
              }
          } else {
              adapter.notifyItemRangeInserted(adapter.getItemCount(), hits.length());
          }
      }
docs: Adds or replaces hits to/in this widget.
  
  @param results     A {@link JSONObject} containing hits.
  @param isReplacing {@code true} if the given hits should replace the current hits.