提交 d2485c4c 编写于 作者: dengyihao's avatar dengyihao

add index test example

上级 8721dc44
......@@ -48,6 +48,7 @@ endif(${BUILD_WITH_ROCKSDB})
## lucene
if(${BUILD_WITH_LUCENE})
cat("${CMAKE_SUPPORT_DIR}/lucene_CMakeLists.txt.in" ${DEPS_TMP_FILE})
add_definitions(-DUSE_LUCENE)
endif(${BUILD_WITH_LUCENE})
## download dependencies
......
......@@ -15,7 +15,6 @@ TEST(IndexTest, index_create_test) {
}
// write
for (int i = 0; i < 100000; i++) {
SIndexMultiTerm* terms = indexMultiTermCreate();
......@@ -32,6 +31,7 @@ TEST(IndexTest, index_create_test) {
val.append("const");
indexMultiTermAdd(terms, "tag4", strlen("tag4"), val.c_str(), val.size());
indexPut(index, terms, i);
indexMultiTermDestroy(terms);
}
......@@ -39,6 +39,7 @@ TEST(IndexTest, index_create_test) {
// query
SIndexMultiTermQuery *multiQuery = indexMultiTermQueryCreate(MUST);
indexMultiTermQueryAdd(multiQuery, "tag1", strlen("tag1"), "field", strlen("field"), QUERY_PREFIX);
indexMultiTermQueryAdd(multiQuery, "tag3", strlen("tag3"), "0field0", strlen("0field0"), QUERY_TERM);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册