[COMPASS-4302] Default query for $search uses deprecated operator Created: 21/May/20  Updated: 29/Oct/23  Resolved: 27/May/20

Status: Closed
Project: Compass
Component/s: Aggregation pipeline
Affects Version/s: 1.21.2
Fix Version/s: 1.22.0

Type: Bug Priority: Major - P3
Reporter: Doug Tarr Assignee: Massimiliano Marcon
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Iteration Elderberry

 Description   

The current default query for $search is

/**
 * search: Analyzed search.
 * term: Unanalyzed 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.
 */
{
 search: {
 query: 'string'
 path: 'string'
 }
}

the search: operator has been deprecated.  It should be replaced with text:

/**
 * text: Analyzed search.
 * term: Unanalyzed 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.
 */
{
 text: {
 query: 'string',
 path: 'string'
 }
}

It's also missing a comma between the query option and the path option, which could be confusing.



 Comments   
Comment by Massimiliano Marcon [ 27/May/20 ]

This will be in 1.22 (beta at .live).

Generated at Wed Feb 07 22:35:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.