| 30 | }; |
| 31 | |
| 32 | static void _Index_ConstructFullTextStructure |
| 33 | ( |
| 34 | Index idx, |
| 35 | RSIndex *rsIdx |
| 36 | ) { |
| 37 | ASSERT(idx != NULL); |
| 38 | ASSERT(rsIdx != NULL); |
| 39 | |
| 40 | uint fields_count = array_len(idx->fields); |
| 41 | |
| 42 | for(uint i = 0; i < fields_count; i++) { |
| 43 | IndexField *field = idx->fields + i; |
| 44 | // introduce text field |
| 45 | unsigned options = RSFLDOPT_NONE; |
| 46 | if(field->nostem) { |
| 47 | options |= RSFLDOPT_TXTNOSTEM; |
| 48 | } |
| 49 | |
| 50 | if(strcmp(field->phonetic, INDEX_FIELD_DEFAULT_PHONETIC) != 0) { |
| 51 | options |= RSFLDOPT_TXTPHONETIC; |
| 52 | } |
| 53 | |
| 54 | RSFieldID fieldID = RediSearch_CreateField(rsIdx, field->name, |
| 55 | RSFLDTYPE_FULLTEXT, options); |
| 56 | RediSearch_TextFieldSetWeight(rsIdx, fieldID, field->weight); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | static void _Index_ConstructExactMatchStructure |
| 61 | ( |
no test coverage detected