8000 Feature/internal issue #654 by Dronplane · Pull Request #10456 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Feature/internal issue #654 #10456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added more tests
  • Loading branch information
Dronplane committed Nov 14, 2019
commit f2643cf53af74232651ed58fff215a6f6eb17ab6
32 changes: 28 additions & 4 deletions tests/IResearch/IResearchQueryPhrase-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,30 @@ TEST_F(IResearchQueryPhraseTest, test) {
ASSERT_TRUE(result.result.is(TRI_ERROR_BAD_PARAMETER));
}

// test invalid input type (invalid order of terms) [] args
{
auto result = arangodb::tests::executeQuery(
vocbase,
"FOR d IN testView SEARCH PHRASE(d['value'], 1, ['12312'], ['12313']) SORT BM25(d) ASC, TFIDF(d) DESC, d.seq RETURN d");
ASSERT_TRUE(result.result.is(TRI_ERROR_BAD_PARAMETER));
}

// test invalid input type (invalid order of terms 2) [] args
{
auto result = arangodb::tests::executeQuery(
vocbase,
"FOR d IN testView SEARCH PHRASE(d['value'], ['12312'], ['12313'], 2 ) SORT BM25(d) ASC, TFIDF(d) DESC, d.seq RETURN d");
ASSERT_TRUE(result.result.is(TRI_ERROR_BAD_PARAMETER));
}

// test invalid input type (invalid order of terms 3) [] args
{
auto result = arangodb::tests::executeQuery(
vocbase,
"FOR d IN testView SEARCH PHRASE(d['value'], ['12312'], 2, 2, ['12313']) SORT BM25(d) ASC, TFIDF(d) DESC, d.seq RETURN d");
ASSERT_TRUE(result.result.is(TRI_ERROR_BAD_PARAMETER));
}

// test invalid input type (invalid order of terms) via []
{
auto result = arangodb::tests::executeQuery(
Expand Down Expand Up @@ -1977,7 +2001,7 @@ TEST_F(IResearchQueryPhraseTest, test) {
std::vector<arangodb::velocypack::Slice> expected = {};
auto result = arangodb::tests::executeQuery(
vocbase,
"FOR d IN testView SEARCH ANALYZER(PHRASE(d['duplicated'], [ 'v', 1, "
"FOR d IN testView SEARCH PHRASE(d['duplicated'], [ 'v', 1, "
"'c' ], 'test_analyzer'), 'identity') SORT BM25(d) ASC, TFIDF(d) DESC, "
"d.seq RETURN d");
ASSERT_TRUE(result.result.ok());
Expand All @@ -2003,7 +2027,7 @@ TEST_F(IResearchQueryPhraseTest, test) {
};
auto result = arangodb::tests::executeQuery(
vocbase,
"FOR d IN testView SEARCH ANALYZER(PHRASE(d.duplicated, 'a', 'b', 1, 'd'), "
"FOR d IN testView SEARCH PHRASE(d.duplicated, ['a', 'b'], 1, ['d'], "
"'test_analyzer') SORT BM25(d) ASC, TFIDF(d) DESC, d.seq RETURN d");
ASSERT_TRUE(result.result.ok());
auto slice = result.data->slice();
Expand All @@ -2028,7 +2052,7 @@ TEST_F(IResearchQueryPhraseTest, test) {
};
auto result = arangodb::tests::executeQuery(
vocbase,
"FOR d IN testView SEARCH ANALYZER(PHRASE(d.duplicated, ['a', 'b', 1, 'd']), "
"FOR d IN testView SEARCH PHRASE(d.duplicated, ['a', 'b', 1, 'd'], "
"'test_analyzer') SORT BM25(d) ASC, TFIDF(d) DESC, d.seq RETURN d");
ASSERT_TRUE(result.result.ok());
auto slice = result.data->slice();
Expand All @@ -2053,7 +2077,7 @@ TEST_F(IResearchQueryPhraseTest, test) {
};
auto result = arangodb::tests::executeQuery(
vocbase,
"FOR d IN testView SEARCH ANALYZER(PHRASE(d.duplicated, 'a', 1, 'c', 'd'), "
"FOR d IN testView SEARCH PHRASE(d.duplicated, ['a', 1, 'c'], 0, 'd', "
"'test_analyzer') SORT BM25(d) ASC, TFIDF(d) DESC, d.seq RETURN d");
ASSERT_TRUE(result.result.ok());
auto slice = result.data->slice();
Expand Down
0