mirror of https://gitee.com/bigwinds/arangodb
unify index struct return values in cluster and non-cluster for fulltext and geo indexes (#2534)
This commit is contained in:
parent
ae429ecf23
commit
5ad9423f16
|
@ -114,8 +114,6 @@ MMFilesFulltextIndex::MMFilesFulltextIndex(TRI_idx_iid_t iid,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
MMFilesFulltextIndex::~MMFilesFulltextIndex() {
|
||||
if (_fulltextIndex != nullptr) {
|
||||
LOG_TOPIC(TRACE, arangodb::Logger::FIXME) << "destroying fulltext index";
|
||||
|
|
|
@ -170,9 +170,13 @@ static int EnhanceJsonIndexPersistent(VPackSlice const definition,
|
|||
|
||||
static void ProcessIndexGeoJsonFlag(VPackSlice const definition,
|
||||
VPackBuilder& builder) {
|
||||
bool geoJson =
|
||||
basics::VelocyPackHelper::getBooleanValue(definition, "geoJson", false);
|
||||
builder.add("geoJson", VPackValue(geoJson));
|
||||
VPackSlice fieldsSlice = definition.get("fields");
|
||||
if (fieldsSlice.isArray() && fieldsSlice.length() == 1) {
|
||||
// only add geoJson for indexes with a single field (with needs to be an array)
|
||||
bool geoJson =
|
||||
basics::VelocyPackHelper::getBooleanValue(definition, "geoJson", false);
|
||||
builder.add("geoJson", VPackValue(geoJson));
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -221,6 +225,10 @@ static int EnhanceJsonIndexFulltext(VPackSlice const definition,
|
|||
VPackBuilder& builder, bool create) {
|
||||
int res = ProcessIndexFields(definition, builder, 1, create);
|
||||
if (res == TRI_ERROR_NO_ERROR) {
|
||||
// hard-coded defaults
|
||||
builder.add("sparse", VPackValue(true));
|
||||
builder.add("unique", VPackValue(false));
|
||||
|
||||
// handle "minLength" attribute
|
||||
int minWordLength = TRI_FULLTEXT_MIN_WORD_LENGTH_DEFAULT;
|
||||
VPackSlice minLength = definition.get("minLength");
|
||||
|
|
|
@ -170,9 +170,13 @@ static int EnhanceJsonIndexPersistent(VPackSlice const definition,
|
|||
|
||||
static void ProcessIndexGeoJsonFlag(VPackSlice const definition,
|
||||
VPackBuilder& builder) {
|
||||
bool geoJson =
|
||||
basics::VelocyPackHelper::getBooleanValue(definition, "geoJson", false);
|
||||
builder.add("geoJson", VPackValue(geoJson));
|
||||
VPackSlice fieldsSlice = definition.get("fields");
|
||||
if (fieldsSlice.isArray() && fieldsSlice.length() == 1) {
|
||||
// only add geoJson for indexes with a single field (with needs to be an array)
|
||||
bool geoJson =
|
||||
basics::VelocyPackHelper::getBooleanValue(definition, "geoJson", false);
|
||||
builder.add("geoJson", VPackValue(geoJson));
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -222,6 +226,10 @@ static int EnhanceJsonIndexFulltext(VPackSlice const definition,
|
|||
VPackBuilder& builder, bool create) {
|
||||
int res = ProcessIndexFields(definition, builder, 1, create);
|
||||
if (res == TRI_ERROR_NO_ERROR) {
|
||||
// hard-coded defaults
|
||||
builder.add("sparse", VPackValue(true));
|
||||
builder.add("unique", VPackValue(false));
|
||||
|
||||
// handle "minLength" attribute
|
||||
int minWordLength = TRI_FULLTEXT_MIN_WORD_LENGTH_DEFAULT;
|
||||
VPackSlice minLength = definition.get("minLength");
|
||||
|
|
Loading…
Reference in New Issue