8000 fixed issue #4185: On execution of FULLTEXT search / AQL query db is … by jsteemann · Pull Request #4238 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

fixed issue #4185: On execution of FULLTEXT search / AQL query db is … #4238

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 6 commits into from
Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to 8000
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Changing warning to exception to satisfy test
  • Loading branch information
graetzer committed Jan 12, 2018
commit 64e417cdfcc9404c8568da7b9488a953730ccb7e
12 changes: 4 additions & 8 deletions arangod/MMFiles/MMFilesAqlFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,31 +178,27 @@ AqlValue MMFilesAqlFunctions::Fulltext(

AqlValue collectionValue = ExtractFunctionParameterValue(parameters, 0);
if (!collectionValue.isString()) {
THROW_ARANGO_EXCEPTION_PARAMS(
TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "FULLTEXT");
THROW_ARANGO_EXCEPTION_PARAMS(TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "FULLTEXT");
}
std::string const cname(collectionValue.slice().copyString());

AqlValue attribute = ExtractFunctionParameterValue(parameters, 1);
if (!attribute.isString()) {
THROW_ARANGO_EXCEPTION_PARAMS(
TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "FULLTEXT");
THROW_ARANGO_EXCEPTION_PARAMS(TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "FULLTEXT");
}
std::string const attributeName(attribute.slice().copyString());

AqlValue queryValue = ExtractFunctionParameterValue(parameters, 2);
if (!queryValue.isString()) {
THROW_ARANGO_EXCEPTION_PARAMS(
TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "FULLTEXT");
THROW_ARANGO_EXCEPTION_PARAMS(TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "FULLTEXT");
}
std::string const queryString = queryValue.slice().copyString();

size_t maxResults = 0; // 0 means "all results"
if (parameters.size() >= 4) {
AqlValue limit = ExtractFunctionParameterValue(parameters, 3);
if (!limit.isNull(true) && !limit.isNumber()) {
THROW_ARANGO_EXCEPTION_PARAMS(
TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "FULLTEXT");
THROW_ARANGO_EXCEPTION_PARAMS(TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "FULLTEXT");
}
if (limit.isNumber()) {
int64_t value = limit.toInt64(trx);
Expand Down
3 changes: 1 addition & 2 deletions js/server/modules/@arangodb/aql.js
Original file line number Diff line number Diff line change
Expand Up @@ -4354,8 +4354,7 @@ function AQL_FULLTEXT (collection, attribute, query, limit) {
var idx = INDEX_FULLTEXT(COLLECTION(collection, 'FULLTEXT'), attribute);

if (idx === null) {
WARN('FULLTEXT', INTERNAL.errors.ERROR_QUERY_FULLTEXT_INDEX_MISSING, collection);
return null;
THROW('FULLTEXT', INTERNAL.errors.ERROR_QUERY_FULLTEXT_INDEX_MISSING, collection);
}

// Just start a simple query
Expand Down
0