Skip to content

Commit

Permalink
Add mongodb indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
denis256 committed May 15, 2023
1 parent 2c216b7 commit 323478a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public PolydataMongodb(String mongoUri) {

public void prepareStorage(String dataset) {
collection(dataset).createIndex(Indexes.ascending(INDEXES));
collection(dataset).createIndex(Indexes.ascending(CREATE_DATE));
collection(dataset).createIndex(Indexes.ascending(UPDATE_DATE));
}

@Override
Expand Down Expand Up @@ -463,7 +465,7 @@ private void recalculateIndex(String dataset) {
Aggregates.unwind("$" + INDEXES),
Aggregates.group("$" + INDEXES, Accumulators.sum("count", 1))
)
);
).allowDiskUse(true);

try (MongoCursor<Document> iterator = documents.iterator()) {
BasicPoly indexes = BasicPoly.newPoly(dataset);
Expand Down

0 comments on commit 323478a

Please sign in to comment.