How to define Atlas Search index without analyzer?

Hey there,

I’m creating the geo index in one of my collections. In the UI it says it uses default analyzer which is completely useless for my case (geo-queries only).

When switched to simple analyzer the index got a little bit smaller.

Is there a way how to disable it completely to save some resources?

Welcome back @Ikar_Pohorsky.

You can try to use the lucene.keyword analyzer as one option, or you can index only the fields that you need, rather than dynamic:true. Defining a specific subset of fields is the best path for reducing the size of your index.

Thanks @Marcus ,

setting keyword analyzer didn’t help much - the index size was about the same.

my index definition is following:

'mappings': {
    'dynamic': False,
    'fields': {
        'geometry': {
            'type': 'geo'
        }
    }
},

The UI also confirms the dynamic mapping is disabled.

But I’d guess - when your search is based purely on geometry:

'$search': {
    'geoWithin': {
        'path': 'geometry',
        'geometry': geometry,
    },
    'index': INDEX_NAME_AVAILABILITY,
},

…you don’t need any analyzers, do you? The question is how to disable it completely.