code: protected void addResourceToUpdateData(CmsPublishedResource pubRes, CmsSearchIndexUpdateData updateData) {
  
          if (pubRes.getState().isDeleted()) {
              // deleted resource just needs to be removed
              updateData.addResourceToDelete(pubRes);
          } else if (pubRes.getState().isNew() || pubRes.getState().isChanged() || pubRes.getState().isUnchanged()) {
              updateData.addResourceToUpdate(pubRes);
          }
      }
docs: Adds a given published resource to the provided search index update data.<p>
  
  This method decides if the resource has to be included in the "update" or "delete" list.<p>
  
  @param pubRes the published resource to add
  @param updateData the search index update data to add the resource to