Skip to content

Commit 06699b1

Browse files
committed
mango: add type specifications and unit tests for text cursor
1 parent 0a58f4e commit 06699b1

File tree

2 files changed

+848
-0
lines changed

2 files changed

+848
-0
lines changed

src/mango/src/mango.hrl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
% License for the specific language governing permissions and limitations under
1111
% the License.
1212

13+
-include_lib("mem3/include/mem3.hrl").
14+
1315
-record(idx, {
1416
dbname,
1517
ddoc,
@@ -35,10 +37,13 @@
3537
| {'op_regex', binary()}.
3638

3739
-type database() :: binary().
40+
-type partition() :: binary().
41+
-type design_doc_id() :: binary().
3842
-type field() :: binary().
3943
-type fields() :: all_fields | [field()].
4044
-type selector() :: any().
4145
-type ejson() :: {[{atom(), any()}]}.
46+
-type text_query() :: binary().
4247

4348
-type cursor_options() :: [{term(), term()}].
4449
-type comparator() :: '$lt' | '$lte' | '$eq' | '$gte' | '$gt'.
@@ -83,3 +88,11 @@
8388
}.
8489

8590
-type cursor_kind() :: explain | find.
91+
92+
-type text_sort_query() :: binary() | relevance.
93+
-type text_bookmark() :: nil | [{#shard{}, any()}].
94+
-type text_hit() :: any().
95+
96+
-type explain_text_property() :: {query, text_query()}
97+
| {partition, partition()}
98+
| {sort, text_sort_query()}.

0 commit comments

Comments
 (0)