You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to create different index on the same field. FullText and LSM_TREE. The first is for searches based on a part of the number.
The second is for when the exact field value is available.
I have this index:
CREATEINDEX `Investigacion_cuij_lucene` IF NOT EXISTS ON`Legajo` (cuij) FULL_TEXT; <<--- this is inherited CREATEINDEX `Legajo_cuij` IF NOT EXISTS ON`Legajo` (cuij) UNIQUE;
But ArcadeDB fail with this error:
2026-09-17 08:43:40.560 INFO [PostCommandHandler] <nodo1> Error on command execution (PostCommandHandler): Cannot create the
index on type 'Legajo' properties [cuij] as LSM_TREE (unique=true) because the index 'Investigacion_cuij_lucene' already exists on the parent
type 'Investigacion' and the same properties as FULL_TEXT (unique=false). Drop the parent index or align the definition: it is not replaced
implicitly because that would take the index away from the parent type
Thanks for the detailed report. I looked into this and it is not a bug: it is a deliberate design invariant, not something that slipped through.
LocalDocumentType.indexesByProperties keys an index by its property set, and the engine holds exactly one index per property set per type (see the javadocs on IndexBuilder.conflictWithExistingIndex / conflictWithExistingIndexName and TypeIndexBuilder.indexesByProperties). That is why creating Legajo_cuij (LSM_TREE UNIQUE) on cuij is refused once Investigacion_cuij_lucene (FULL_TEXT) already covers cuij on the parent type Investigacion: the refusal is on purpose so that a second CREATE INDEX can never silently take an index away from a parent type (issue #4083) or leave a type briefly/permanently without an index if a replacing rebuild fails partway.
OrientDB allowed several index definitions to coexist on the same property set; ArcadeDB intentionally narrowed that to one, and query planning, index selection, SEARCH_INDEX(...), DROP INDEX, and rebuild all assume it. Relaxing it to "N indexes per property set" would be a real schema/storage/planner change (not a quick fix), and is out of scope for this batch, which is bug fixes only.
Workarounds available today, in order of preference:
Put the two indexes on different property sets. If you can afford a second, denormalized property (e.g. a computed/duplicate cuij_text property kept in sync, or an embedded/virtual property) you can put FULL_TEXT on one and UNIQUE/LSM_TREE on the other, and both live side by side because they no longer collide on the same property list.
Define the FULL_TEXT index directly on Legajo instead of inheriting it from Investigacion, if the parent type does not itself need full-text search on cuij. A same-type FULL_TEXT + a same-type LSM_TREE UNIQUE on the same property still collide today (same invariant), so this only helps if the full-text requirement is really per-subtype.
Track uniqueness with a UNIQUE constraint enforced at the application layer (or a trigger/BEFORE INSERT/BEFORE UPDATE hook doing an exact-match lookup through the full-text index) instead of a second index, if you can tolerate giving up the index-backed enforcement.
If multi-index-per-property is something you'd like to see supported, I'd suggest filing it as a separate feature request so it can be scoped and designed properly rather than folded into this fix batch.
I'm leaving the "in progress" label off this one for now since there's no code change planned here - happy to revisit if a feature request is opened.
Closing as by design - the investigation is in the comment above and the reporter has a workaround.
Recorded for the record in PR #7845's description: one index per property set per type is a deliberate invariant (LocalDocumentType.indexesByProperties), not an oversight. Replacing an inherited index implicitly would silently take it away from the parent type (#4083).
Reopen if the inheritance rule itself should be revisited - that would be a separate design change rather than a bug in the current behaviour.
Activity
lvca commentedon Sep 17, 2026
Thanks for the detailed report. I looked into this and it is not a bug: it is a deliberate design invariant, not something that slipped through.
LocalDocumentType.indexesByPropertieskeys an index by its property set, and the engine holds exactly one index per property set per type (see the javadocs onIndexBuilder.conflictWithExistingIndex/conflictWithExistingIndexNameandTypeIndexBuilder.indexesByProperties). That is why creatingLegajo_cuij(LSM_TREE UNIQUE) oncuijis refused onceInvestigacion_cuij_lucene(FULL_TEXT) already coverscuijon the parent typeInvestigacion: the refusal is on purpose so that a secondCREATE INDEXcan never silently take an index away from a parent type (issue #4083) or leave a type briefly/permanently without an index if a replacing rebuild fails partway.OrientDB allowed several index definitions to coexist on the same property set; ArcadeDB intentionally narrowed that to one, and query planning, index selection,
SEARCH_INDEX(...),DROP INDEX, and rebuild all assume it. Relaxing it to "N indexes per property set" would be a real schema/storage/planner change (not a quick fix), and is out of scope for this batch, which is bug fixes only.Workarounds available today, in order of preference:
cuij_textproperty kept in sync, or an embedded/virtual property) you can putFULL_TEXTon one andUNIQUE/LSM_TREEon the other, and both live side by side because they no longer collide on the same property list.FULL_TEXTindex directly onLegajoinstead of inheriting it fromInvestigacion, if the parent type does not itself need full-text search oncuij. A same-type FULL_TEXT + a same-type LSM_TREE UNIQUE on the same property still collide today (same invariant), so this only helps if the full-text requirement is really per-subtype.UNIQUEconstraint enforced at the application layer (or a trigger/BEFORE INSERT/BEFORE UPDATEhook doing an exact-match lookup through the full-text index) instead of a second index, if you can tolerate giving up the index-backed enforcement.If multi-index-per-property is something you'd like to see supported, I'd suggest filing it as a separate feature request so it can be scoped and designed properly rather than folded into this fix batch.
I'm leaving the "in progress" label off this one for now since there's no code change planned here - happy to revisit if a feature request is opened.
mdre commentedon Sep 17, 2026
Thanks @lvca. We can use a workaround.
Fix issues ArcadeData#7774, ArcadeData#7773, ArcadeData#7766, ArcadeD…
lvca commentedon Sep 21, 2026
Closing as by design - the investigation is in the comment above and the reporter has a workaround.
Recorded for the record in PR #7845's description: one index per property set per type is a deliberate invariant (
LocalDocumentType.indexesByProperties), not an oversight. Replacing an inherited index implicitly would silently take it away from the parent type (#4083).Reopen if the inheritance rule itself should be revisited - that would be a separate design change rather than a bug in the current behaviour.