Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DOCSP-46479: document Scout integration #3261

Merged
merged 14 commits into from
Mar 5, 2025

Conversation

rustagir
Copy link
Contributor

@rustagir rustagir commented Feb 3, 2025

https://jira.mongodb.org/browse/DOCSP-46479

Document the Scout integration.

STAGING

Checklist

  • Add tests and ensure they pass

@rustagir rustagir requested a review from a team as a code owner February 3, 2025 17:09
@rustagir rustagir requested a review from norareidy February 3, 2025 17:09
@github-actions github-actions bot added the docs label Feb 3, 2025
Copy link
Contributor

@norareidy norareidy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this, I left some suggestions!

@rustagir rustagir requested a review from norareidy February 3, 2025 20:19
Copy link
Contributor

@norareidy norareidy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some small comments!

@rustagir rustagir requested a review from GromNaN February 3, 2025 21:44
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about putting a note at the beginning to say that if the data is in MongoDB, it's possible to create a search index without using scout with a link to the search indexes.

Scout from MongoDB to MongoDB is only useful if you want to denormalize additional data (such as adding data from a relationship to the main document).

docs/scout.txt Outdated
Comment on lines 32 to 35
- Provides an abstraction to create search indexes on documents in
MongoDB collections and external search engines. In MongoDB, this feature
allows you to create :atlas:`Atlas Search indexes
</atlas-search/manage-indexes/>`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this part I would not mention other search engines. It's more: create MongoDB Atlas Indexes from any model (SQL or MongoDB).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update this list item; can you clarify how one would use Laravel MongoDB to work with SQL models? Is this possible, or is that a general statement about Laravel as a framework in general?

docs/scout.txt Outdated
Comment on lines 42 to 46
.. note:: Deployment Compatibility

You can use Laravel Scout only when you connect to MongoDB Atlas
clusters. This feature is not available for self-managed or
serverless deployments.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search indexes are available using atlas local, or the the mongodb/mongodb-atlas-local docker image (link). I use this docker image for testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on the language used on the website, Self-managed refers to Enterprise and Advanced and community edition MongoDB. So, I can adjust the first sentence to say deployments instead of clusters.

@rustagir rustagir requested a review from GromNaN February 6, 2025 20:00
@rustagir
Copy link
Contributor Author

rustagir commented Feb 6, 2025

@GromNaN Qs:

  • Is the information about denormalizing the data helpful for users to know or is it in the technical weeds?
  • Should the forthcoming tutorial (the TODO in this PR) that shows users how to use Scout to import into Meilisearch be centered in this page instead of the MongoDB to MongoDB examples?

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the information about denormalizing the data helpful for users to know or is it in the technical weeds?

I'm not sure to understand your question. There is the method toSearchableArray to customize the documents that are sent to the search engine, that can be documented. And the part about retreiving ids from the search engine, then querying the database with this ids in good to know to understand the performance implications and the benefit of using atlas search directly on mongodb models.

Should the forthcoming tutorial (the TODO in this PR) that shows users how to use Scout to import into Meilisearch be centered in this page instead of the MongoDB to MongoDB examples?

I'm not certain we need to document indexation from MongoDB to an other search engine. That's already documented on the Laravel website: https://laravel.com/docs/11.x/scout
It "justs works" with MongoDB models.

@rustagir rustagir requested a review from GromNaN February 27, 2025 15:26
docs/scout.txt Outdated
indexes, see the :ref:`laravel-as-index` section of the Atlas
Search guide.

- Allows you to automatically replicate data from MongoDB into a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that “allows” is a word to be avoided (exept when talking about permissions, security). It's better to use "enable", for example.

@rustagir rustagir requested a review from GromNaN March 3, 2025 19:12
@rustagir rustagir changed the base branch from 5.x to 5.2 March 3, 2025 20:39
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This is a good piece of docs.

@rustagir rustagir merged commit 937fb27 into mongodb:5.2 Mar 5, 2025
62 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants