Skip to content

Commit

Permalink
add interval indexer tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
shpilu committed Dec 16, 2018
1 parent 1243931 commit d342fa4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/example/tutorial_interval.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ const char* g_index_schema = "{ \
},{ \
\"name\":\"age\", \
\"key_type\":\"int32\", \
\"index_type\":\"simple\" \
},{ \
\"name\":\"student\", \
\"key_type\":\"bool\", \
\"index_type\":\"simple\" \
\"index_type\":\"interval\" \
},{ \
\"name\":\"gendor\", \
\"key_type\":\"string\", \
Expand All @@ -38,15 +34,14 @@ int main() {
std::cout << "cloriSearch init success" << std::endl;
}

for (int i = 1; i < 12; ++i) {
std::string key = std::string("../conf/simple_index_test/simple_index_") + std::to_string(i) + ".json";
for (int i = 1; i <= 3; ++i) {
std::string key = std::string("../conf/interval_index_test/index_") + std::to_string(i) + ".json";
std::cout << key << std::endl;

std::fstream in(key.c_str());
std::istreambuf_iterator<char> begin(in);
std::istreambuf_iterator<char> end;
std::string dnf_str(begin, end);
// std::cout << "raw_dnf=" << dnf_str << std::endl;

if (sch->Add(dnf_str, IndexSchemaFormat::ISF_JSON, false)) {
std::cout << "add index success" << std::endl;
Expand Down

0 comments on commit d342fa4

Please sign in to comment.