Zero 'Minimum chunk overlap' causes Typed property not initialized
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3469278. -->
Reported by: [seogow](https://www.drupal.org/user/3065779)
Related to !50
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When 'Minimum chunk overlap' is set to zero at Search API AI Search server configuration, an exception 'Typed property Drupal\ai_search\Base\EmbeddingStrategyPluginBase::$chunkMinOverlap must not be accessed before initialization' is thrown during indexing.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Create new AI Search server and set 'Minimum chunk overlap' as 0.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>The issue is <code>ai_search/src/Base/EmbeddingStrategyPluginBase.php</code>, lines 107-109, where the variable is not initialized if the value is 0.</p>
<p>My suggested solution would be replace the code with: <code>$this->chunkMinOverlap = (int) $configuration['chunk_min_overlap']</code>;</p>
issue