From 32b2ae61253687cb6155f34d5843c5174e319842 Mon Sep 17 00:00:00 2001 From: Cristian Goina Date: Fri, 17 May 2024 09:56:20 -0400 Subject: [PATCH] changed some indexes --- .../dao/mongo/NeuronMetadataMongoDao.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/colormipsearch-persist/src/main/java/org/janelia/colormipsearch/dao/mongo/NeuronMetadataMongoDao.java b/colormipsearch-persist/src/main/java/org/janelia/colormipsearch/dao/mongo/NeuronMetadataMongoDao.java index 32d39cdb..bfeefdce 100644 --- a/colormipsearch-persist/src/main/java/org/janelia/colormipsearch/dao/mongo/NeuronMetadataMongoDao.java +++ b/colormipsearch-persist/src/main/java/org/janelia/colormipsearch/dao/mongo/NeuronMetadataMongoDao.java @@ -60,13 +60,15 @@ public NeuronMetadataMongoDao(MongoDatabase mongoDatabase, IdGenerator idGenerat @Override protected void createDocumentIndexes() { + // use hashed indexes for values that makes sense to be in different shards mongoCollection.createIndex(Indexes.hashed("class")); mongoCollection.createIndex(Indexes.hashed("libraryName")); - mongoCollection.createIndex(Indexes.hashed("publishedName")); - mongoCollection.createIndex(Indexes.hashed("mipId")); + mongoCollection.createIndex(Indexes.ascending("publishedName")); + mongoCollection.createIndex(Indexes.ascending("slideCode")); + mongoCollection.createIndex(Indexes.ascending("mipId")); mongoCollection.createIndex(Indexes.ascending("tags")); - mongoCollection.createIndex(Indexes.hashed("neuronType")); - mongoCollection.createIndex(Indexes.hashed("neuronInstance")); + mongoCollection.createIndex(Indexes.ascending("neuronType")); + mongoCollection.createIndex(Indexes.ascending("neuronInstance")); mongoCollection.createIndex(Indexes.ascending( "computeFiles.InputColorDepthImage", "computeFiles.SourceColorDepthImage" ));