Skip to content

DOCSP-51348-atlas-search-page #122

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

Merged
merged 4 commits into from
Jul 25, 2025

Conversation

shuangela
Copy link
Collaborator

@shuangela shuangela commented Jul 23, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-51348

Staging Links

  • atlas-search
  • Self-Review Checklist

    • Is this free of any warnings or errors in the RST?
    • Did you run a spell-check?
    • Did you run a grammar-check?
    • Are all the links working?
    • Are the facets and meta keywords accurate?
    • Are the page titles greater than 20 characters long and SEO relevant?

    Copy link

    netlify bot commented Jul 23, 2025

    Deploy Preview for docs-kotlin-sync ready!

    Name Link
    🔨 Latest commit b4c8f65
    🔍 Latest deploy log https://app.netlify.com/projects/docs-kotlin-sync/deploys/68838dd06e86d90008f44a8c
    😎 Deploy Preview https://deploy-preview-122--docs-kotlin-sync.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify project configuration.

    @docs-builder-bot
    Copy link

    docs-builder-bot commented Jul 23, 2025

    🔄 Deploy Preview for docs-kotlin-sync processing

    Item Details
    🔨 Latest Commit 9e8f0de62ae764c3c9dafee530edb9df06afafeb
    😎 Deploy Preview https://deploy-preview-122--docs-kotlin-sync.netlify.app
    🔍 Build Logs View Logs

    @shuangela shuangela mentioned this pull request Jul 23, 2025
    6 tasks
    Copy link
    Collaborator

    @stephmarie17 stephmarie17 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!

    This aggregation pipeline operator is only available for collections hosted
    on :atlas:`MongoDB Atlas </>` clusters running v4.2 or later that are
    covered by an :atlas:`Atlas search index </reference/atlas-search/index-definitions/>`.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    [s] Looking at the Atlas Search Overview page, it seems like when this is phrased "Atlas Search index" the "S" is capitalized but if it's just "search index" then it's lowercase.

    Suggested change
    covered by an :atlas:`Atlas search index </reference/atlas-search/index-definitions/>`.
    covered by an :atlas:`Atlas Search index </reference/atlas-search/index-definitions/>`.

    Comment on lines 103 to 104
    on :atlas:`$searchMeta </atlas-search/query-syntax/#-searchmeta>`.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    [q] Does this page contain version availability? I didn't see it at the linked page. This one has a little note about sharded collection compatibility but that's it.

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    good catch, i took this from the java docs. can remove!

    on :atlas:`$searchMeta </atlas-search/query-syntax/#-searchmeta>`.

    The following example shows the ``near`` metadata for an Atlas search
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Suggested change
    The following example shows the ``near`` metadata for an Atlas search
    The following example shows the ``near`` metadata for an Atlas Search

    @shuangela shuangela marked this pull request as ready for review July 24, 2025 19:31
    @shuangela shuangela requested a review from a team as a code owner July 24, 2025 19:31
    @shuangela shuangela requested review from NathanQingyangXu and removed request for a team July 24, 2025 19:31
    Copy link

    @NathanQingyangXu NathanQingyangXu left a comment

    Choose a reason for hiding this comment

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

    Overall great; with some minor issues to consider improving on.

    Use the ``searchMeta()`` method to create a :manual:`$searchMeta
    </reference/operator/aggregation/searchMeta/>` pipeline stage, which returns
    only the metadata from of the Atlas full-text search results.

    Choose a reason for hiding this comment

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

    from of?

    val settings = MongoClientSettings.builder()
    .applyConnectionString(ConnectionString(uri))
    .retryWrites(true)
    .build()

    Choose a reason for hiding this comment

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

    seems it will align better with existing pattern to connection uri placeholder in code directly without indirection of a constant field:

    val uri = "<connection string>"
    
    val settings = MongoClientSettings.builder()
            .applyConnectionString(ConnectionString(uri))
            .retryWrites(true)
            .build()
    


    // Uncomment the methods that correspond to what you're testing
    // runAtlasTextSearchMeta(collection)
    }

    Choose a reason for hiding this comment

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

    do we need the above comment? For one thing, it is not methods to be uncommented for the statement below is a method invocation, not the method declaration per se; so Uncomment the below statement is better?

    But given we have provided this method as example, I think simply using it directly makes more sense:

    runAtlasTextSearchMeta(collection)
    

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    true, this is a remnant of old code where there were multiple methods that could be tested 😅 good catch!

    val database = mongoClient.getDatabase("sample_mflix")
    val collection = database.getCollection<Document>("movies")

    // Queries for documents that have a "title" value containing the word "Alabama"

    Choose a reason for hiding this comment

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

    the above comment might not be 100% accurate, for text operator relies on some analyzer so it allows for some extent of fuzzy matching. For instance, if the title contains word ALABAMA, it could be returned as well. Also, the "title" here is a field, so the verbiage is far from accurate.
    A better one might be:

    Full-text search on "title" field using query "Alabama"
    

    Seems the code has been self-explanatory so no additional comment is needed?

    @shuangela shuangela merged commit 9084089 into mongodb:comp-cov Jul 25, 2025
    6 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants