From 24f0547ee18dd098d44cb27d32d081d432f1fed6 Mon Sep 17 00:00:00 2001 From: "hs.zhang" <22708345+cangfengzhs@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:15:59 +0800 Subject: [PATCH] modify ft index default limit size (#5260) * modify ft index default limit size * fix test Co-authored-by: Doodle <13706157+critical27@users.noreply.github.com> --- src/common/expression/TextSearchExpression.h | 2 +- src/graph/util/test/FTindexUtilsTest.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/expression/TextSearchExpression.h b/src/common/expression/TextSearchExpression.h index 078068111ae..b4239d91933 100644 --- a/src/common/expression/TextSearchExpression.h +++ b/src/common/expression/TextSearchExpression.h @@ -85,7 +85,7 @@ class TextSearchArgument final { std::string val_; std::string op_; int32_t fuzziness_{-2}; - int32_t limit_{-1}; + int32_t limit_{10000}; int32_t timeout_{-1}; }; diff --git a/src/graph/util/test/FTindexUtilsTest.cpp b/src/graph/util/test/FTindexUtilsTest.cpp index f131d054993..41dff6a0dd4 100644 --- a/src/graph/util/test/FTindexUtilsTest.cpp +++ b/src/graph/util/test/FTindexUtilsTest.cpp @@ -70,7 +70,7 @@ TEST_F(FTIndexUtilsTest, rewriteTSFilter) { esResult.items = items; { MockESAdapter mockESAdapter; - EXPECT_CALL(mockESAdapter, prefix(indexName, "prefix_pattern", -1, -1)) + EXPECT_CALL(mockESAdapter, prefix(indexName, "prefix_pattern", 10000, -1)) .WillOnce(Return(esResult)); auto argument = TextSearchArgument::make(&pool, tagName, propName, "prefix_pattern"); auto expr = TextSearchExpression::makePrefix(&pool, argument); @@ -84,7 +84,7 @@ TEST_F(FTIndexUtilsTest, rewriteTSFilter) { { plugin::ESQueryResult emptyEsResult; MockESAdapter mockESAdapter; - EXPECT_CALL(mockESAdapter, prefix(indexName, "prefix_pattern", -1, -1)) + EXPECT_CALL(mockESAdapter, prefix(indexName, "prefix_pattern", 10000, -1)) .WillOnce(Return(emptyEsResult)); auto argument = TextSearchArgument::make(&pool, tagName, propName, "prefix_pattern"); auto expr = TextSearchExpression::makePrefix(&pool, argument); @@ -95,7 +95,7 @@ TEST_F(FTIndexUtilsTest, rewriteTSFilter) { { Status status = Status::Error("mock error"); MockESAdapter mockESAdapter; - EXPECT_CALL(mockESAdapter, prefix(indexName, "prefix_pattern", -1, -1)) + EXPECT_CALL(mockESAdapter, prefix(indexName, "prefix_pattern", 10000, -1)) .Times(FLAGS_ft_request_retry_times) .WillRepeatedly(Return(status)); auto argument = TextSearchArgument::make(&pool, tagName, propName, "prefix_pattern"); @@ -106,7 +106,7 @@ TEST_F(FTIndexUtilsTest, rewriteTSFilter) { } { MockESAdapter mockESAdapter; - EXPECT_CALL(mockESAdapter, wildcard(indexName, "wildcard_pattern", -1, -1)) + EXPECT_CALL(mockESAdapter, wildcard(indexName, "wildcard_pattern", 10000, -1)) .WillOnce(Return(esResult)); auto argument = TextSearchArgument::make(&pool, edgeName, propName, "wildcard_pattern"); auto expr = TextSearchExpression::makeWildcard(&pool, argument); @@ -121,7 +121,7 @@ TEST_F(FTIndexUtilsTest, rewriteTSFilter) { plugin::ESQueryResult singleEsResult; singleEsResult.items = {Item("a", "b", 1, "edge text")}; MockESAdapter mockESAdapter; - EXPECT_CALL(mockESAdapter, wildcard(indexName, "wildcard_pattern", -1, -1)) + EXPECT_CALL(mockESAdapter, wildcard(indexName, "wildcard_pattern", 10000, -1)) .WillOnce(Return(singleEsResult)); auto argument = TextSearchArgument::make(&pool, edgeName, propName, "wildcard_pattern"); auto expr = TextSearchExpression::makeWildcard(&pool, argument); @@ -132,7 +132,7 @@ TEST_F(FTIndexUtilsTest, rewriteTSFilter) { } { MockESAdapter mockESAdapter; - EXPECT_CALL(mockESAdapter, regexp(indexName, "regexp_pattern", -1, -1)) + EXPECT_CALL(mockESAdapter, regexp(indexName, "regexp_pattern", 10000, -1)) .WillOnce(Return(esResult)); auto argument = TextSearchArgument::make(&pool, edgeName, propName, "regexp_pattern"); auto expr = TextSearchExpression::makeRegexp(&pool, argument); @@ -145,7 +145,7 @@ TEST_F(FTIndexUtilsTest, rewriteTSFilter) { } { MockESAdapter mockESAdapter; - EXPECT_CALL(mockESAdapter, fuzzy(indexName, "fuzzy_pattern", "1", -1, -1)) + EXPECT_CALL(mockESAdapter, fuzzy(indexName, "fuzzy_pattern", "1", 10000, -1)) .WillOnce(Return(esResult)); auto argument = TextSearchArgument::make(&pool, tagName, propName, "fuzzy_pattern"); argument->setFuzziness(1);