From 0493f47d3d830aca696d91315bd96d88f017f004 Mon Sep 17 00:00:00 2001 From: NPospolita Date: Wed, 28 Oct 2020 11:34:10 +0300 Subject: [PATCH] Fixed several parties search --- .../java/com/rbkmoney/deanonimus/domain/Party.java | 1 + src/test/java/com/rbkmoney/deanonimus/ReadTest.java | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/com/rbkmoney/deanonimus/domain/Party.java b/src/main/java/com/rbkmoney/deanonimus/domain/Party.java index 9768744..a5ad3f0 100644 --- a/src/main/java/com/rbkmoney/deanonimus/domain/Party.java +++ b/src/main/java/com/rbkmoney/deanonimus/domain/Party.java @@ -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; diff --git a/src/test/java/com/rbkmoney/deanonimus/ReadTest.java b/src/test/java/com/rbkmoney/deanonimus/ReadTest.java index 213dd93..eec708c 100644 --- a/src/test/java/com/rbkmoney/deanonimus/ReadTest.java +++ b/src/test/java/com/rbkmoney/deanonimus/ReadTest.java @@ -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 searchHits = deanonimusServiceHandler.searchParty(PARTY + "-test-lol"); + + Assert.assertEquals(1, searchHits.size()); + } + @Test public void searchByPartyEmail() throws TException { givenParty(PARTY, EMAIL);