Skip to content

Commit

Permalink
modify ft index default limit size (#5260)
Browse files Browse the repository at this point in the history
* modify ft index default limit size

* fix test

Co-authored-by: Doodle <13706157+critical27@users.noreply.github.com>
  • Loading branch information
2 people authored and Sophie-Xie committed Jan 28, 2023
1 parent 7c80edb commit 9aac434
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/common/expression/TextSearchExpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};
};

Expand Down
14 changes: 7 additions & 7 deletions src/graph/util/test/FTindexUtilsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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");
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 9aac434

Please sign in to comment.