Merge pull request #6 from rbkmoney/ft/party-id-search-fixed

Fixed several parties search
This commit is contained in:
Pospolita Nikita 2020-10-28 11:55:07 +03:00 committed by GitHub
commit 23481a7280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import java.util.Optional;
public class Party {
@Id
@Field(type = FieldType.Keyword)
private String id;
@Field(type = FieldType.Text, analyzer = "autocomplete", searchAnalyzer = "standard")
private String email;

View File

@ -49,6 +49,19 @@ public class ReadTest extends IntegrationTestBase {
.anyMatch(partySearchHit -> partySearchHit.getParty().getEmail().contains(EMAIL)));
}
@Test
public void searchByPartyIdWithoutTokens() throws TException {
givenParty(PARTY + "-test-kek", EMAIL + "1");
givenParty(PARTY + "-test-lol", EMAIL + "2");
givenParty(PARTY + "-test-rofl", EMAIL + "3");
givenParty(PARTY + "-test-ricardo", EMAIL + "4");
givenParty(PARTY + "-test-milos", EMAIL + "5");
List<SearchHit> searchHits = deanonimusServiceHandler.searchParty(PARTY + "-test-lol");
Assert.assertEquals(1, searchHits.size());
}
@Test
public void searchByPartyEmail() throws TException {
givenParty(PARTY, EMAIL);