MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _Index_ConstructFullTextStructure

Function _Index_ConstructFullTextStructure

src/index/index.c:32–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30};
31
32static 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
60static void _Index_ConstructExactMatchStructure
61(

Callers 1

Index_ConstructStructureFunction · 0.85

Calls 1

array_lenFunction · 0.85

Tested by

no test coverage detected