| 58 | } |
| 59 | |
| 60 | static void _Index_ConstructExactMatchStructure |
| 61 | ( |
| 62 | Index idx, |
| 63 | RSIndex *rsIdx |
| 64 | ) { |
| 65 | ASSERT(idx != NULL); |
| 66 | ASSERT(rsIdx != NULL); |
| 67 | |
| 68 | RSFieldID fieldID; |
| 69 | uint fields_count = array_len(idx->fields); |
| 70 | unsigned types = RSFLDTYPE_NUMERIC | RSFLDTYPE_GEO | RSFLDTYPE_TAG; |
| 71 | |
| 72 | for(uint i = 0; i < fields_count; i++) { |
| 73 | IndexField *field = idx->fields + i; |
| 74 | // introduce both text, numeric and geo fields |
| 75 | fieldID = RediSearch_CreateField(rsIdx, field->name, types, |
| 76 | RSFLDOPT_NONE); |
| 77 | RediSearch_TagFieldSetSeparator(rsIdx, fieldID, INDEX_SEPARATOR); |
| 78 | RediSearch_TagFieldSetCaseSensitive(rsIdx, fieldID, 1); |
| 79 | } |
| 80 | |
| 81 | // introduce edge src and dest node ids as additional index fields |
| 82 | if(idx->entity_type == GETYPE_EDGE) { |
| 83 | RediSearch_CreateField(rsIdx, "_src_id", RSFLDTYPE_NUMERIC, |
| 84 | RSFLDOPT_NONE); |
| 85 | RediSearch_CreateField(rsIdx, "_dest_id", RSFLDTYPE_NUMERIC, |
| 86 | RSFLDOPT_NONE); |
| 87 | } |
| 88 | |
| 89 | // for none indexable types e.g. Array introduce an additional field |
| 90 | // "none_indexable_fields" which will hold a list of attribute names |
| 91 | // that were not indexed |
| 92 | fieldID = RediSearch_CreateField(rsIdx, INDEX_FIELD_NONE_INDEXED, |
| 93 | RSFLDTYPE_TAG, RSFLDOPT_NONE); |
| 94 | RediSearch_TagFieldSetSeparator(rsIdx, fieldID, INDEX_SEPARATOR); |
| 95 | RediSearch_TagFieldSetCaseSensitive(rsIdx, fieldID, 1); |
| 96 | } |
| 97 | |
| 98 | // responsible for creating the index structure only! |
| 99 | // e.g. fields, stopwords, language |
no test coverage detected