Skip to content

IBX-11401: Fixed embedding default model inheritance and added field name fallback prefixes#719

Open
mikadamczyk wants to merge 1 commit intomainfrom
IBX-11401-embedding-field-name
Open

IBX-11401: Fixed embedding default model inheritance and added field name fallback prefixes#719
mikadamczyk wants to merge 1 commit intomainfrom
IBX-11401-embedding-field-name

Conversation

@mikadamczyk
Copy link
Contributor

🎫 Issue IBX-11401

Description:

This PR contains two related core changes needed for Gemini embedding integration and backward-compatible search field naming.

Fixed default_embedding_model inheritance across SiteAccess scopes

Embeddings parser no longer defines a semantic default value for default_embedding_model. A scalar default defined in the semantic config node was being materialized into every SiteAccess/group scope during mapSetting(). This prevented proper inheritance from system.default overrides (e.g., Gemini config set in project config), because scopes such as site / admin_group ended up with explicit text-embedding-ada-002.

  • Removed semantic defaultValue('text-embedding-ada-002') from Embeddings parser
  • Kept the default in core default settings (ibexa.site_access.config.default.default_embedding_model), so BC is preserved
Added generic field name fallback prefixes in FieldNameGenerator

FieldNameGenerator now supports configurable fallback prefixes used when no explicit field type mapping exists. New embedding models should not require adding a dedicated common.yml mapping entry for every model suffix. We need a generic way to turn ibexa_dense_vector_<suffix> into backend field suffix

  • Existing explicit mappings (e.g., OpenAI suffixes) remain unchanged and still take precedence
  • The inheritance fix restores the expected system.default override behavior without changing existing explicit SiteAccess/group overrides

For QA:

Documentation:

@mikadamczyk mikadamczyk self-assigned this Feb 26, 2026
@sonarqubecloud
Copy link

@mikadamczyk mikadamczyk requested a review from a team February 27, 2026 07:38
@ibexa-workflow-automation-1 ibexa-workflow-automation-1 bot requested review from Steveb-p, ViniTou, alongosz, barw4, ciastektk, konradoboza, tbialcz and wiewiurdp and removed request for a team February 27, 2026 07:44
Comment on lines +41 to +43
/**
* @var string[]
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* @var string[]
*/
/** @var string[] */

* @param array<string, string> $fieldNameMapping
* @param string[] $fallbackPrefixes
*/
public function __construct(array $fieldNameMapping, array $fallbackPrefixes = [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Property promotion could be used here.

public function testGetTypedNameUsesConfiguredMapping(): void
{
$generator = new FieldNameGenerator([
'ez_string' => 's',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

Suggested change
'ez_string' => 's',
'ibexa_string' => 's',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants