1 /* 2 Copyright(C) 2009-2017 Brazil 3 Copyright(C) 2019 Kouhei Sutou <kou@clear-code.com> 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with this library; if not, write to the Free Software 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 module groonga_d.ii; 20 21 22 private static import groonga_d.groonga; 23 24 extern(C): 25 nothrow @nogc: 26 27 /* buffered index builder */ 28 29 extern struct _grn_ii; 30 extern struct _grn_ii_buffer; 31 32 alias grn_ii = _grn_ii; 33 alias grn_ii_buffer = _grn_ii_buffer; 34 35 //GRN_API 36 uint grn_ii_get_flags(groonga_d.groonga.grn_ctx* ctx, grn_ii* ii); 37 38 //GRN_API 39 uint grn_ii_get_n_elements(groonga_d.groonga.grn_ctx* ctx, grn_ii* ii); 40 41 //GRN_API 42 void grn_ii_cursor_set_min_enable_set(ubyte enable); 43 44 //GRN_API 45 ubyte grn_ii_cursor_set_min_enable_get(); 46 47 //GRN_API 48 uint grn_ii_estimate_size(groonga_d.groonga.grn_ctx* ctx, grn_ii* ii, uint tid); 49 50 //GRN_API 51 uint grn_ii_estimate_size_for_query(groonga_d.groonga.grn_ctx* ctx, grn_ii* ii, const (char)* query, uint query_len, groonga_d.groonga.grn_search_optarg* optarg); 52 53 //GRN_API 54 uint grn_ii_estimate_size_for_lexicon_cursor(groonga_d.groonga.grn_ctx* ctx, grn_ii* ii, groonga_d.groonga.grn_table_cursor* lexicon_cursor); 55 56 //GRN_API 57 grn_ii_buffer* grn_ii_buffer_open(groonga_d.groonga.grn_ctx* ctx, grn_ii* ii, ulong update_buffer_size); 58 59 //GRN_API 60 groonga_d.groonga.grn_rc grn_ii_buffer_append(groonga_d.groonga.grn_ctx* ctx, grn_ii_buffer* ii_buffer, uint rid, uint section, groonga_d.groonga.grn_obj* value); 61 62 //GRN_API 63 groonga_d.groonga.grn_rc grn_ii_buffer_commit(groonga_d.groonga.grn_ctx* ctx, grn_ii_buffer* ii_buffer); 64 65 //GRN_API 66 groonga_d.groonga.grn_rc grn_ii_buffer_close(groonga_d.groonga.grn_ctx* ctx, grn_ii_buffer* ii_buffer); 67 68 //GRN_API 69 groonga_d.groonga.grn_rc grn_ii_posting_add(groonga_d.groonga.grn_ctx* ctx, groonga_d.groonga.grn_posting* pos, groonga_d.hash.grn_hash* s, groonga_d.groonga.grn_operator op); 70 71 //GRN_API 72 void grn_ii_resolve_sel_and(groonga_d.groonga.grn_ctx* ctx, groonga_d.hash.grn_hash* s, groonga_d.groonga.grn_operator op); 73 74 /* Experimental */ 75 extern struct _grn_ii_cursor; 76 alias grn_ii_cursor = _grn_ii_cursor; 77 78 //GRN_API 79 grn_ii_cursor* grn_ii_cursor_open(groonga_d.groonga.grn_ctx* ctx, grn_ii* ii, uint tid, uint min, uint max, int nelements, int flags); 80 81 //GRN_API 82 groonga_d.groonga.grn_posting* grn_ii_cursor_next(groonga_d.groonga.grn_ctx* ctx, grn_ii_cursor* c); 83 84 //GRN_API 85 groonga_d.groonga.grn_posting* grn_ii_cursor_next_pos(groonga_d.groonga.grn_ctx* ctx, grn_ii_cursor* c); 86 87 //GRN_API 88 groonga_d.groonga.grn_rc grn_ii_cursor_close(groonga_d.groonga.grn_ctx* ctx, grn_ii_cursor* c);