Basic search using term
pipeline = [
{
'$search': {
'text': {
'query': "fight club",
'path': "title"
}
}
}
]
pipeline = [
{
'$search': {
'text': {
'query': "fight club",
'path': "title"
}
},
'fuzzy': {
'maxEdits': 2
}
}
]
pipeline = [
{
'$search': {
'text': {
'query': "fight",
'path': "title"
},
# text highlighting
'highlight': {"path": "title"}
}
}, {
'$project': {
'highlights': {"$meta": "searchHighlights"}
}
}
]
And here's an app that combines it all into a single REST endpoint:
Reach out to Ethan Steininger for help