Some MongoDB-specific indexes, for use on a model’s Meta.indexes
option, are available in django_mongodb_backend.indexes
.
SearchIndex
¶
Added in version 5.2.0b0.
Creates a basic search index on the given field(s).
Some fields such as DecimalField
aren’t supported. See the Atlas documentation for a complete list of unsupported data types.
If name
isn’t provided, one will be generated automatically. If you need to reference the name in your search query and don’t provide your own name, you can lookup the generated one using Model._meta.indexes[0].name
(substituting the name of your model as well as a different list index if your model has multiple indexes).
VectorSearchIndex
¶
Added in version 5.2.0b0.
A subclass of SearchIndex
that creates a vector search index on the given field(s).
The index must reference at least one vector field: an ArrayField
with a base_field
of FloatField
or IntegerField
and a size
. It cannot reference an ArrayField
of any other type.
It may also have other fields to filter on, provided the field stores boolean
, date
, objectId
, numeric
, string
, or uuid
.
Available values for the required similarities
keyword argument are "cosine"
, "dotProduct"
, and "euclidean"
(see About the Similarity Functions for how to choose). You can provide this value either a string, in which case that value will be applied to all vector fields, or a list or tuple of values with a similarity corresponding to each vector field.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4