-
Notifications
You must be signed in to change notification settings - Fork 1.4k
DOCSP-46269: atlas search & atlas vector search pages #3255
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
Conversation
a22decf
to
403d10a
Compare
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.
Good work so far! A few formatting and wording suggestions
docs/fundamentals/as-avs.txt
Outdated
- ``exact``: ``bool`` (default: ``false``) | ||
- ``filter``: ``QueryInterface`` or ``array`` (default: no filtering) | ||
- ``numCandidates``: ``int`` or ``null`` (default: ``null``) |
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.
S: Same as above. I think I would create a table here with descriptions
docs/fundamentals/as-avs.txt
Outdated
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.
Wouldn't it be more readable to use a full name instead of this abbreviations I've never seen before?
atlas-search.txt
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 wanted to be comprehensive as Atlas Search and Atlas Vector Search are two separate features. But I can change the file name to atlas-search-vector-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.
Maybe create 2 pages that link each other. Indeed that's 2 distinct features.
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.
Thanks, LGTM w/ small suggestions!
docs/fundamentals/as-avs.txt
Outdated
- ``index``: ``string`` | ||
- ``highlight``: ``array`` | ||
- ``concurrent``: ``bool`` | ||
- ``count``: ``string`` | ||
- ``searchAfter``: ``string`` | ||
- ``searchBefore`` ``string`` | ||
- ``scoreDetails``: ``bool`` | ||
- ``sort``: ``array`` | ||
- ``returnStoredSource``: ``bool`` | ||
- ``tracking``: ``array`` |
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.
Hmm, perhaps listing the names of the parameters without the data type would suffice then, since the atlas documentation also includes the data type. The data type seems like unnecessary info if I don't know what the parameter is for. I'll leave up to you though!
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.
2 remaining TODO, otherwise LGTM
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.
While running tests on the project, I found some issues with those introduced by this PR. They were not executed because the phpunit group is missing. Fixes in #3279
* @runInSeparateProcess | ||
* @preserveGlobalState disabled | ||
*/ | ||
public function autocompleteSearchTest(): void |
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 test is not executed. In PHPUnit, test must be prefixed with test
: testAutocompleteSearch
* @runInSeparateProcess | ||
* @preserveGlobalState disabled | ||
*/ | ||
public function vectorSearchTest(): void |
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.
Same issue with this test name: testVectorSearch
do { | ||
$ready = true; | ||
usleep(10_000); | ||
foreach ($collection->listSearchIndexes() as $index) { |
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 get this error:
Undefined variable $collection
The variable is named $moviesCollection
.
*/ | ||
public function vectorSearchTest(): void | ||
{ | ||
$results = Book::vectorSearch( |
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.
The class is not imported, add use MongoDB\Laravel\Tests\Models\Book
to the file.
$movies = Movie::search( | ||
sort: ['title' => 1], | ||
operator: Search::text('title', 'dream'), | ||
)->get(); |
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.
Movie::search
returns an instance of Illuminate\Support\Collection
. The method all()
should be called to get all the results. get
is to get a single item.
public function autocompleteSearchTest(): void | ||
{ | ||
// start-auto-query | ||
$movies = Movie::autocomplete('title', 'jak')->get(); |
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.
Movie::search
returns an instance of Illuminate\Support\Collection
. The method all()
should be called to get all the results. get
is to get a single item.
documents api for atlas search & vector search
https://jira.mongodb.org/browse/DOCSP-46269
Staging -
Checklist