-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add Search to Aggregate pipeline #7238
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
Comments
Pull Request #7237 |
The pipeline keys haven't been updated since Mongo 3.2. I believe we can remove that check to support all stages now and future additions to mongo. What do you think? |
I like that Idea. Do you want me to update my PR to remove that check? |
Go for it |
@dplewis Do you think that adding a search query to parse would be something useful or is doing a search through aggregate good enough? |
We have fullText search builtin to the Server. |
Right, I understand that. I was just thinking that it would make it easier for people to use their search indexes in Parse. For example in the JS SDK the API could look like this: const searchText = 'cool text for search 03/03/21';
const Post = Parse.Object.extend("Post");
const postQuery = new Parse.Query(Post);
const searchQuery =
{
text: {
path: ['body', 'title', 'postDate'],
query: searchText,
fuzzy: {
maxEdits: 1,
prefixLength: 2,
maxExpansion: 100
}
}
};
const res = await postQuery.search(searchQuery);
// autocomplete
const searchQuery =
{
autocomplete: {
path: 'title',
query: searchText,
tokenOrder: 'any|sequential',
fuzzy: {
maxEdits: 1,
prefixLength: 2,
maxExpansion: 100
}
}
};
// true denoting that this search is a autocomplete search
const res = await postQuery.search(searchQuery, true); I do understand if you think that this would be overkill for Parse Server. |
closing via #7237 |
New Feature / Enhancement Checklist
Current Limitation
Can not use the
$search
operator in aggregate pipelinesFeature / Enhancement Description
MongoDB Atlas has a search index for collections. You can find out more here. The way you use your search index is through aggregate. Right now if you add search to your pipeline parse throws an error.
You have to have mongo 4.2 and above and have MongoDB hosted on atlas.
Example Use Case
etc. (anything that you need to search)
Alternatives / Workarounds
Right now you have to use parse fulltext search which just uses a text index. You do not get fuzzy search and autocomplete
The text was updated successfully, but these errors were encountered: