-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix wildcard Query case sensitive in ES (#1614)
- Loading branch information
Showing
3 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -699,6 +699,83 @@ public void lookup_person_acl_counted() throws Exception { | |
} | ||
|
||
|
||
@Test | ||
public void search_wildcard_is_case_insensitive() { | ||
databaseHelper.addObject(""" | ||
person: DIGITALOCEAN NOC | ||
nic-hdl: EH3832-RIPE | ||
mnt-by: OWNER-MNT | ||
source: TEST | ||
created: 2022-08-14T11:48:28Z | ||
last-modified: 2022-10-25T12:22:39Z | ||
"""); | ||
|
||
databaseHelper.addObject(""" | ||
person: DigitalOcean Inc | ||
nic-hdl: DI2361-RIPE | ||
mnt-by: OWNER-MNT | ||
source: TEST | ||
created: 2022-08-14T11:48:28Z | ||
last-modified: 2022-10-25T12:22:39Z | ||
"""); | ||
|
||
databaseHelper.addObject(""" | ||
person: DigitalOcean Inc | ||
nic-hdl: DI2362-RIPE | ||
mnt-by: OWNER-MNT | ||
source: TEST | ||
created: 2022-08-14T11:48:28Z | ||
last-modified: 2022-10-25T12:22:39Z | ||
"""); | ||
|
||
databaseHelper.addObject(""" | ||
organisation: ORG-DOI2-RIPE | ||
org-name: DigitalOcean, LLC | ||
country: US | ||
org-type: OTHER | ||
mnt-by: OWNER-MNT | ||
abuse-c: DI2362-RIPE | ||
e-mail: [email protected] | ||
notify: [email protected] | ||
language: EN | ||
source: TEST | ||
created: 2022-08-14T11:48:28Z | ||
last-modified: 2022-10-25T12:22:39Z | ||
"""); | ||
|
||
databaseHelper.addObject(""" | ||
person: DigitalOcean Network Operations | ||
nic-hdl: PT7353-RIPE | ||
mnt-by: OWNER-MNT | ||
source: TEST | ||
created: 2022-08-14T11:48:28Z | ||
last-modified: 2022-10-25T12:22:39Z | ||
"""); | ||
|
||
rebuildIndex(); | ||
|
||
|
||
final SearchResult resultUppercase = createResource("entities?fn=DIGITALOCEAN*") | ||
.request(MediaType.APPLICATION_JSON_TYPE) | ||
.get(SearchResult.class); | ||
|
||
final SearchResult resultLowercase = createResource("entities?fn=digitalocean*") | ||
.request(MediaType.APPLICATION_JSON_TYPE) | ||
.get(SearchResult.class); | ||
|
||
final SearchResult resultMix = createResource("entities?fn=DigItAlocEan*") | ||
.request(MediaType.APPLICATION_JSON_TYPE) | ||
.get(SearchResult.class); | ||
|
||
assertThat(resultUppercase.getEntitySearchResults().size(), is(5)); | ||
assertThat(resultLowercase.getEntitySearchResults().size(), is(5)); | ||
assertThat(resultMix.getEntitySearchResults().size(), is(5)); | ||
|
||
assertThat(resultUppercase.getEntitySearchResults(), is(resultLowercase.getEntitySearchResults())); | ||
assertThat(resultLowercase.getEntitySearchResults(), is(resultMix.getEntitySearchResults())); | ||
} | ||
|
||
|
||
// search - ips | ||
|
||
@Test | ||
|