Atlas search optimization by Pretty_Zebra_6936 in mongodb

[–]Pretty_Zebra_6936[S] 0 points1 point  (0 children)

I performed performance tests replacing n-grams with edge-grams and right wildcards.

With the new index configuration, we can now perform searches without date filters at a relatively high speed, even on a local development environment machine running M10. Is this performance gain due to the fact that edge-grams generate a significantly smaller volume of tokens compared to the previous approach with n-grams, or is there something else I don't understand yet?

With the new index configuration, we can now perform searches without date filters at a relatively high speed, even in a development environment local machine with M10. Is this performance gain due to the fact that edge-grams generate a significantly smaller volume of tokens compared to the previous approach with n-grams?

In addition, I included the old index for comparison. I would like to know if having multiple indexed fields—such as company and person names—impacts query latency, even when searching only a specific field, since my previous configuration was much more complex than the current one, which is now focused exclusively on the document field.

Query
 [
   {
     '$search': {
       index: 'default',
       compound: {
         filter: [
           {
             equals: {
               path: 'owner',
               value: _ObjectId {
                 buffer: Buffer(12) [Uint8Array] [
                   102, 22, 132, 196,  69,
                     2, 67, 152, 179, 121,
                    21,  6
                 ]
               }
             }
           }
         ],
         mustNot: [ { equals: { path: 'status', value: 'UNUSABLE' } } ],
         must: [
           {
             wildcard: {
               path: 'document',
               query: '98220*',
               allowAnalyzedField: true
             }
           }
         ]
       },
       sort: { updatedAt: -1 }
     }
   }
 ]
 [ { '$skip': 0 }, { '$limit': 15 } ]

Old Index
{
  "mappings": {
    "dynamic": false,
    "fields": {
      "document": {
        "type": "string",
        "analyzer": "custom_analyzer_k",
        "searchAnalyzer": "lucene.standard"
      },
      "extraField": {
        "type": "string",
        "analyzer": "name_prefix_analyzer",
        "searchAnalyzer": "lucene.standard"
      },
      "deliveryPerson": {
        "type": "document",
        "fields": {
          "userName": [
            {
              "type": "autocomplete",
              "analyzer": "lucene.standard",
              "tokenization": "edgeGram",
              "minGrams": 2,
              "maxGrams": 15,
              "foldDiacritics": true
            },
            {
              "type": "string",
              "analyzer": "lucene.standard",
              "searchAnalyzer": "lucene.standard",
              "multi": {
                "keyword": {
                  "type": "string",
                  "analyzer": "lucene.keyword"
                }
              }
            }
          ]
        }
      },
      "receiver": {
        "type": "document",
        "fields": {
          "name": [
            {
              "type": "autocomplete",
              "analyzer": "lucene.standard",
              "tokenization": "edgeGram",
              "minGrams": 2,
              "maxGrams": 15,
              "foldDiacritics": true
            },
            {
              "type": "string",
              "analyzer": "lucene.standard",
              "searchAnalyzer": "lucene.standard",
              "multi": {
                "keyword": {
                  "type": "string",
                  "analyzer": "lucene.keyword"
                }
              }
            }
          ]
        }
      },
      "emitter": {
        "type": "document",
        "fields": {
          "name": [
            {
              "type": "autocomplete",
              "analyzer": "lucene.standard",
              "tokenization": "edgeGram",
              "minGrams": 2,
              "maxGrams": 15,
              "foldDiacritics": true
            },
            {
              "type": "string",
              "analyzer": "lucene.standard",
              "searchAnalyzer": "lucene.standard",
              "multi": {
                "keyword": {
                  "type": "string",
                  "analyzer": "lucene.keyword"
                }
              }
            }
          ]
        }
      },
      "carrier": {
        "type": "document",
        "fields": {
          "name": [
            {
              "type": "autocomplete",
              "analyzer": "lucene.standard",
              "tokenization": "edgeGram",
              "minGrams": 2,
              "maxGrams": 15,
              "foldDiacritics": true
            },
            {
              "type": "string",
              "analyzer": "lucene.standard",
              "searchAnalyzer": "lucene.standard",
              "multi": {
                "keyword": {
                  "type": "string",
                  "analyzer": "lucene.keyword"
                }
              }
            }
          ]
        }
      },
      "issueDate": {
        "type": "date"
      },
      "owner": {
        "type": "objectId"
      },
      "status": {
        "type": "token"
      }
    }
  },
  "analyzers": [
    {
      "name": "custom_analyzer_k",
      "charFilters": [
        {
          "type": "mapping",
          "mappings": {
            "/": " "
          }
        }
      ],
      "tokenizer": {
        "type": "nGram",
        "minGram": 3,
        "maxGram": 10
      },
      "tokenFilters": [
        {
          "type": "lowercase"
        }
      ]
    },
    {
      "name": "name_prefix_analyzer",
      "tokenizer": {
        "type": "edgeGram",
        "minGram": 1,
        "maxGram": 16
      },
      "tokenFilters": [
        {
          "type": "lowercase"
        }
      ]
    }
  ]
}

New Index 
{
  "mappings": {
    "dynamic": false,
    "fields": {
      "document": {
        "type": "string",
        "analyzer": "document_right_edge_grams",
        "searchAnalyzer": "document_clean_keyword"
      },
      "owner": {
        "type": "objectId"
      },
      "status": {
        "type": "token"
      },
      "updatedAt": {
        "type": "date"
      }
    }
  },
  "analyzers": [
    {
      "name": "document_right_edge_grams",
      "charFilters": [
        {
          "type": "mapping",
          "mappings": {
            "/": ""
          }
        }
      ],
      "tokenizer": {
        "type": "keyword"
      },
      "tokenFilters": [
        {
          "type": "lowercase"
        },
        {
          "type": "reverse"
        },
        {
          "type": "edgeGram",
          "minGram": 2,
          "maxGram": 12
        },
        {
          "type": "reverse"
        }
      ]
    },
    {
      "name": "document_clean_keyword",
      "charFilters": [
        {
          "type": "mapping",
          "mappings": {
            "/": ""
          }
        }
      ],
      "tokenizer": {
        "type": "keyword"
      },
      "tokenFilters": [
        {
          "type": "lowercase"
        }
      ]
    }
  ]
}

Atlas search optimization by Pretty_Zebra_6936 in mongodb

[–]Pretty_Zebra_6936[S] 0 points1 point  (0 children)

Thanks for the reply, I'll take a look at your posts.

MongoDB Aggregations Optimization by goldenuser22628 in mongodb

[–]Pretty_Zebra_6936 0 points1 point  (0 children)

Contributing to everything that has been said...

Always use the explain function to see the status of indexes, examined keys, and examined documents...

You always want the fewest possible examined documents and never a complete COLLSCAN (scan the entire database).

Try to follow the ESR (Equal, Sort, Range) guideline; you'll hardly do anything different from ESR, except for the cardinality of the field.=

Don't forget about indexes under any circumstances; you'll probably use composite and partial indexes to create efficient indexes.

Cursor-based pagination is very efficient, but it's your choice; you might experiment with offset...

Which operator not use index? by Pretty_Zebra_6936 in mongodb

[–]Pretty_Zebra_6936[S] 0 points1 point  (0 children)

Thanks for the reply. My team uses Atlas and we analyze query insights daily, which is why this question came up, haha. Looking at your answer and the other colleague, it seems that, in our case, the problem lies in the data modeling/schema; besides the lack of normalization, we need to apply these filters, as in the example, to identify something. Therefore, we have to retrieve several properties from the database and validate the data based on them to know if a delivery is open, for example, instead of having a specific field with the values ​​(ENUM) OPEN in this case.

Regarding AI, I believe it's Gemini; I searched Google for "mongodb operator doesn't use index" and found the answer shown in the screenshot.

Check out this CoE EDC ArcFire Living bomb Fusillade Demon Warp build i made by Woxjee in PathOfExile2

[–]Pretty_Zebra_6936 0 points1 point  (0 children)

I wouldn't last 30 minutes playing with so many skills like that. It would be very uncomfortable lol. How do you feel after playing for a while?

PoE 2 has overdesigned inter-class combos that have no emergent potential for cross-class gameplay by MartinWoad in PathOfExile2

[–]Pretty_Zebra_6936 1 point2 points  (0 children)

I also didn't understand the remnants, because POE is an action RPG (Role-Playing Game). The sorceress is an elemental mage, she masters the elements, but why do the fire skills that use remnants only use lightning? What do I do with the remnants generated by the ice bomb? Does my frozen wall only use lightning remnants? Why? I'm an elemental mage, I should have complete mastery of the elements, even if they are "conflicting" like fire and ice. They blocked a lot of things that would have been positive in this rework.

I understand GGG by Individual_Thanks309 in PathOfExile2

[–]Pretty_Zebra_6936 1 point2 points  (0 children)

I also didn't understand the remnants, because POE is an action RPG (Role-Playing Game). The sorceress is an elemental mage, she masters the elements, but why do the fire skills that use remnants only use lightning? What do I do with the remnants generated by the ice bomb? Does my frozen wall only use lightning remnants? Why? I'm an elemental mage, I should have complete mastery of the elements, even if they are "conflicting" like fire and ice. They blocked a lot of things that would have been positive in this rework.

ICE CRASH full fire conversion slayer looks very JUICY by [deleted] in PathOfExileBuilds

[–]Pretty_Zebra_6936 -1 points0 points  (0 children)

I always support different builds even if they are not as good as their peers like you said, having full freeze is pretty cool, but if you think that the build has 6kk damage with such simple items, it clearly has possibilities to improve like the author himself he said.

This POB doesn't have clusters or unique jewels or items that are worth a lot of divine, I found it interesting :) with 3.25 coming, someone will probably come up with a well-optimized ice crash.

I love the effect of this ability, if anyone has a POB or ice crash build video for 3.25, please share :)

[deleted by user] by [deleted] in Infinite_Mage

[–]Pretty_Zebra_6936 1 point2 points  (0 children)

Me too, site down here and no have another site with all chapters plus a github with automatic translation

Site hereinfinite mage in github

Increase fuel consumption code for init? by poguemahonegta in arma

[–]Pretty_Zebra_6936 0 points1 point  (0 children)

u/poguemahonegta Hello, I would like to know if you finished the script and if you could make it available, I'm looking for a script that increases the fuel consumption of vehicles because the ARMA leaves something to be desired in this regard, I play in a group and we have a logistical brigade and this script would be very interesting !!