Пример #1
0
 public void index(final String projectUuid) {
   deleteByProject(projectUuid);
   super.index(
       new IndexerTask() {
         @Override
         public long index(long lastUpdatedAt) {
           return doIndex(lastUpdatedAt, projectUuid);
         }
       });
 }
Пример #2
0
  @Test
  public void delete_by_project_uuid() throws Exception {
    indexTest("P1", "F1", "T1", "U111");
    indexTest("P1", "F1", "T2", "U112");
    indexTest("P1", "F2", "T1", "U121");
    indexTest("P2", "F3", "T1", "U231");

    underTest.deleteByProject("P1");

    List<SearchHit> hits = getDocuments();
    assertThat(hits).hasSize(1);
    Map<String, Object> document = hits.get(0).getSource();
    assertThat(hits).hasSize(1);
    assertThat(document.get(FIELD_PROJECT_UUID)).isEqualTo("P2");
  }