-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.22.0
-
Component/s: Aggregation pipeline
-
None
-
Iteration Lime
-
Not Needed
The template for the $search stage can be difficult to get started with because the index is missing from the template, yet it is still required. The name of the search index is defined at creation.
If we re-add that template, it will be easier for developers to comprehend. Here is an example:
/** * index: the name of the Search index. * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. * term: Un-analyzed search. * compound: Combines ops. * span: Find in text field regions. * exists: Test for presence of a field. * near: Find near number or date. * range: Find in numeric or date range. */ { index: 'movies', text: { query: 'base', path: 'plot' } }
I've attached a video to make the explanation easier.