api-collab / api-collab-server

0 stars 2 forks source link

API Suggestions - Lucene adding duplicate records in to index #45

Closed kand617 closed 6 years ago

kand617 commented 6 years ago
        service.processDocuments(asList(VALID_API_SPEC));
        service.processDocuments(asList(VALID_API_SPEC));

        String query = "pet";
        List<String> words = service.search(query);
        List<String> unique  = words.stream().distinct().collect(Collectors.toList());
        assertThat(unique.size()).isEqualTo(words.size());
sudhirtumati commented 6 years ago

I couldn't reproduce the issue. Below is the test I tried to reproduce it with

@Test
public void indexSpecWithDuplicates() {
    service.processDocuments(Collections.singletonList("pet petlist petstore pet petlist petstore"));
    service.processDocuments(Collections.singletonList("pet petlist petstore pet petlist petstore"));
    List<String> words = service.search("pet");
    assertThat(words).hasSize(3);
    assertThat(words).contains("pet", "petlist", "petstore");
}

@kand617 Could you checkout duplicate_search_result_test branch and see if you can reproduce the issue?

kand617 commented 6 years ago

@sudhirtumati I have updated the test