Skip to content

Commit

Permalink
excluding from source unused fields, _all field wrongly spelled as al…
Browse files Browse the repository at this point in the history
…l which was causing large responses and OOM errors
  • Loading branch information
fmendezh committed Oct 9, 2024
1 parent 2f26438 commit 7c1b04a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,43 @@ public class LiteratureEsFieldMapper implements EsFieldMapper<LiteratureSearchPa
private static final FieldSortBuilder[] SORT =
new FieldSortBuilder[] {SortBuilders.fieldSort("created").order(SortOrder.DESC)};

private static final String[] EXCLUDE_FIELDS = new String[] {"all"};
private static final String[] EXCLUDE_FIELDS = new String[] {
"_all",
"authored",
"chapter",
"city",
"code",
"confirmed",
"contentType",
"department",
"edition",
"editors",
"fileAttached",
"genre",
"groupId",
"gbifFeatureId",
"hidden",
"institution",
"issue",
"medium",
"pages",
"patentApplicationNumber",
"patentLegalStatus",
"patentOwner",
"privatePublication",
"profileId",
"read",
"reprintEdition",
"revision",
"searchable",
"series",
"seriesEditor",
"shortTitle",
"sourceType",
"starred",
"translators",
"userContext",
"volume"};

public static final List<String> DATE_FIELDS =
ImmutableList.of("created", "createdAt", "updatedAt", "accessed");
Expand Down Expand Up @@ -156,8 +192,7 @@ public String[] getMappedFields() {
"peerReview",
"gbifProjectIdentifier",
"gbifProgrammeAcronym",
"openAccess",
"language"
"openAccess"
};
}

Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
application:
name: literature-ws
cloud:
zookeeper:
enabled: false
elasticsearch:
hosts: http://cms-search.gbif-dev.org:9200/
hosts: http://localhost:9200
index: literature
connectionTimeOut: 60000
socketTimeOut: 60000
connectionRequestTimeOut: 120000
maxResultWindow: 20000
literature:
bufferLimitBytesExport: 200000000

0 comments on commit 7c1b04a

Please sign in to comment.