Skip to content

Commit

Permalink
[feat][document] Implement document index add, del and search.
Browse files Browse the repository at this point in the history
Signed-off-by: Ketor <[email protected]>
  • Loading branch information
ketor authored and rock-git committed May 20, 2024
1 parent 24e56fb commit 27a33c4
Show file tree
Hide file tree
Showing 6 changed files with 353 additions and 155 deletions.
23 changes: 4 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ option(BRPC_ENABLE_CPU_PROFILER "Enable brpc cpu profiler" OFF)
option(XDPROCKS_PATH "Enable xdprocks raw engine")
option(BUILD_PYTHON_SDK "Build python sdk" OFF)
option(VECTORIZATION_INSTRUCTION_SET "vectorization instruction set")
option(WITH_DOC "Build document" OFF)

message(STATUS CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
message(STATUS THIRD_PARTY_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE})
Expand Down Expand Up @@ -233,9 +232,7 @@ include(bdb)
include(brpc)
include(braft)
include(nlohmann)
if(WITH_DOC)
include(tantivy-search)
endif()
include(tantivy-search)

if(BUILD_BENCHMARK STREQUAL "ON")
include(hdf5)
Expand Down Expand Up @@ -316,10 +313,7 @@ include_directories(${LIBUNWIND_INCLUDE_DIR})
include_directories(${LIBBACKTRACE_INCLUDE_DIR})
include_directories(${HDF5_INCLUDE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/src)

if(WITH_DOC)
include_directories(${TANTIVY_SEARCH_INCLUDE_DIR})
endif()
include_directories(${TANTIVY_SEARCH_INCLUDE_DIR})

# CAUTION: the order of the libraries is important, please do not change it.
set(DYNAMIC_LIB
Expand All @@ -344,15 +338,9 @@ set(DYNAMIC_LIB
${LIBBACKTRACE_LIBRARIES}
${ZLIB_LIBRARIES}
${BDB_LIBRARIES}
${TANTIVY_SEARCH_LIBRARIES}
)

if(WITH_DOC)
set(DYNAMIC_LIB
${DYNAMIC_LIB}
${TANTIVY_SEARCH_LIBRARIES}
)
endif()

if (ENABLE_XDPROCKS)
set(DYNAMIC_LIB
${DYNAMIC_LIB}
Expand Down Expand Up @@ -400,12 +388,9 @@ set(DEPEND_LIBS
bdb
rapidjson
nlohmann-json
tantivy-search
)

if(WITH_DOC)
set(DEPEND_LIBS ${DEPEND_LIBS} tantivy-search)
endif()

if(WITH_MKL)
if(DEFINED ENV{MKLROOT})
message(STATUS "MKLROOT is: $ENV{MKLROOT}")
Expand Down
4 changes: 2 additions & 2 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,8 @@ message DocumentValue {
// data type of scalar field
// for document, only INT64, DOUBLE and STRING is supported
ScalarFieldType field_type = 1;
// scalar field, only one element in most cases
ScalarField fields = 2;
// scalar field
ScalarField field_value = 2;
}

message Document {
Expand Down
Loading

0 comments on commit 27a33c4

Please sign in to comment.