-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-5543: Add new options for Atlas Search Text and Phrase operators #1678
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
Changes from all commits
494a486
c563ebe
5e845d6
573fcc1
a7a6fa5
b75bcc8
71ec65b
d9a7434
24f4c85
79bb9e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* Copyright 2010-present MongoDB Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace MongoDB.Driver.Search | ||
{ | ||
/// <summary> | ||
/// Represents the criteria used to match terms in a query for the Atlas Search Text operator. | ||
/// </summary> | ||
public enum MatchCriteria | ||
{ | ||
/// <summary> | ||
/// Match documents containing any of the terms from a query. | ||
/// </summary> | ||
Any, | ||
/// <summary> | ||
/// Match documents containing all the terms from a query. | ||
/// </summary> | ||
All | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* Copyright 2010-present MongoDB Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace MongoDB.Driver.Search | ||
{ | ||
/// <summary> | ||
/// Options for atlas search phrase operator. | ||
/// </summary> | ||
public sealed class SearchPhraseOptions<TDocument> | ||
{ | ||
/// <summary> | ||
/// The score modifier. | ||
/// </summary> | ||
public SearchScoreDefinition<TDocument> Score { get; set; } | ||
|
||
/// <summary> | ||
/// The allowable distance between words in the query phrase. | ||
/// </summary> | ||
public int? Slop { get; set; } | ||
|
||
/// <summary> | ||
/// The name of the synonym mapping definition in the index definition. Value can't be an empty string (e.g. ""). | ||
/// </summary> | ||
public string Synonyms { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* Copyright 2010-present MongoDB Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace MongoDB.Driver.Search | ||
{ | ||
/// <summary> | ||
/// Options for atlas search text operator. | ||
/// </summary> | ||
public sealed class SearchTextOptions<TDocument> | ||
{ | ||
/// <summary> | ||
/// The options for fuzzy search. | ||
/// </summary> | ||
public SearchFuzzyOptions Fuzzy { get; set; } | ||
|
||
/// <summary> | ||
/// The criteria to use to match the terms in the query. Value can be either "any" or "all". | ||
/// Defaults to "all" if omitted. | ||
/// </summary> | ||
public MatchCriteria? MatchCriteria { get; set; } | ||
|
||
/// <summary> | ||
/// The score modifier. | ||
/// </summary> | ||
public SearchScoreDefinition<TDocument> Score { get; set; } | ||
|
||
/// <summary> | ||
/// The name of the synonym mapping definition in the index definition. Value can't be an empty string (e.g. ""). | ||
/// </summary> | ||
public string Synonyms { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. xml-docs says: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to my other comment I prefer letting the server error rather than enforcing the condition in the driver. Yes, it's simple but I don't think the driver should be doing that much hand holding. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we letting server to decide, why do we have it in XML docs then? =) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's in the XML docs because I mirrored the official docs and it's mentioned there. I didn't think much of it. |
||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.