@@ -36,13 +36,14 @@ public Query(string rawQuery, string search, string[] terms, string[] searchTerm
36
36
/// <summary>
37
37
/// Search part of a query.
38
38
/// This will not include action keyword if exclusive plugin gets it, otherwise it should be same as RawQuery.
39
- /// Since we allow user to switch a exclusive plugin to generic plugin,
39
+ /// Since we allow user to switch a exclusive plugin to generic plugin,
40
40
/// so this property will always give you the "real" query part of the query
41
41
/// </summary>
42
42
public string Search { get ; internal init ; }
43
43
44
44
/// <summary>
45
45
/// The search string split into a string array.
46
+ /// Does not include the <see cref="ActionKeyword"/>.
46
47
/// </summary>
47
48
public string [ ] SearchTerms { get ; init ; }
48
49
@@ -59,6 +60,7 @@ public Query(string rawQuery, string search, string[] terms, string[] searchTerm
59
60
60
61
[ Obsolete ( "Typo" ) ]
61
62
public const string TermSeperater = TermSeparator ;
63
+
62
64
/// <summary>
63
65
/// User can set multiple action keywords seperated by ';'
64
66
/// </summary>
@@ -69,15 +71,22 @@ public Query(string rawQuery, string search, string[] terms, string[] searchTerm
69
71
70
72
71
73
/// <summary>
72
- /// '*' is used for System Plugin
74
+ /// Wildcard action keyword. Plugins using this value will be queried on every search.
73
75
/// </summary>
74
76
public const string GlobalPluginWildcardSign = "*" ;
75
77
78
+ /// <summary>
79
+ /// The action keyword part of this query.
80
+ /// For global plugins this value will be empty.
81
+ /// </summary>
76
82
public string ActionKeyword { get ; init ; }
77
83
78
84
/// <summary>
79
- /// Return first search split by space if it has
85
+ /// Splits <see cref="SearchTerms"/> by spaces and returns the first item.
80
86
/// </summary>
87
+ /// <remarks>
88
+ /// returns an empty string when <see cref="SearchTerms"/> does not have enough items.
89
+ /// </remarks>
81
90
public string FirstSearch => SplitSearch ( 0 ) ;
82
91
83
92
private string _secondToEndSearch ;
@@ -88,20 +97,27 @@ public Query(string rawQuery, string search, string[] terms, string[] searchTerm
88
97
public string SecondToEndSearch => SearchTerms . Length > 1 ? ( _secondToEndSearch ??= string . Join ( ' ' , SearchTerms [ 1 ..] ) ) : "" ;
89
98
90
99
/// <summary>
91
- /// Return second search split by space if it has
100
+ /// Splits <see cref="SearchTerms"/> by spaces and returns the second item.
92
101
/// </summary>
102
+ /// <remarks>
103
+ /// returns an empty string when <see cref="SearchTerms"/> does not have enough items.
104
+ /// </remarks>
93
105
public string SecondSearch => SplitSearch ( 1 ) ;
94
106
95
107
/// <summary>
96
- /// Return third search split by space if it has
108
+ /// Splits <see cref="SearchTerms"/> by spaces and returns the third item.
97
109
/// </summary>
110
+ /// <remarks>
111
+ /// returns an empty string when <see cref="SearchTerms"/> does not have enough items.
112
+ /// </remarks>
98
113
public string ThirdSearch => SplitSearch ( 2 ) ;
99
114
100
115
private string SplitSearch ( int index )
101
116
{
102
117
return index < SearchTerms . Length ? SearchTerms [ index ] : string . Empty ;
103
118
}
104
119
120
+ /// <inheritdoc />
105
121
public override string ToString ( ) => RawQuery ;
106
122
}
107
123
}
0 commit comments