-
Notifications
You must be signed in to change notification settings - Fork 6
DOCSP-49758: Atlas search indexes #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
DOCSP-49758: Atlas search indexes #29
Conversation
✅ Deploy Preview for docs-django ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
class Meta: | ||
db_table = "recipes" | ||
indexes = [ | ||
SearchIndex(fields=["title"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the indent style that Django uses:
SearchIndex(
fields=["title"],
name="title_search_idx",
)
source/model-data/indexes.txt
Outdated
|
||
- ``fields``: The fields you want to index. | ||
- ``name``: *(Optional)* The name of your Atlas Search index. If you do not | ||
specify this argument, {+django-odm+} automatically generates an index name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually the behavior of Django to automatically generate an index name rather than Django Mongo Backend.
|
||
To create an Atlas Search index, assign the ``indexes`` option in your model's | ||
``Meta`` class to a ``SearchIndex`` object. Pass the following arguments to the | ||
``SearchIndex()`` constructor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to add interphinx support for django_mongodb_backend, e.g.
:class:`~django_mongodb_backend.indexes.SearchIndex`
(could be done separately)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a link to the SearchIndex class to the tip at the end of this section
source/model-data/indexes.txt
Outdated
Atlas Search Indexes | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Atlas Search indexes specify the behavior of an Atlas Search, or a full-text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit naive on this functionaltiy, but I'm not sure what "or" means here. Does it mean "in other words"?
https://www.mongodb.com/docs/atlas/atlas-search/ says "Atlas Search is an embedded full-text search"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, "in other words." I changed to "which is" for clarity
Also, this feature will only be in Django MongoDB Backend 5.2.x for Django 5.2.x, so a prerequisite to this documentation is to create the branch for 5.1.x and update the master branch to 5.2.x. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-49758
Staging Links
Self-Review Checklist