Skip to content

Commit

Permalink
Fix Smile-SA#74 - Better admin for fuzziness config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurélien FOUCRET committed Jul 12, 2016
1 parent 9862a8a commit b88a60c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Smile Elastic Suite to newer
* versions in the future.
*
* @category Smile
* @package Smile\ElasticsuiteCore
* @author Aurelien FOUCRET <[email protected]>
* @copyright 2016 Smile
* @license Open Software License ("OSL") v. 3.0
*/

namespace Smile\ElasticsuiteCore\Model\Config\Source;

/**
* Fuzziness value config source model.
*
* @category Smile
* @package Smile\ElasticsuiteCore
* @author Aurelien FOUCRET <[email protected]>
*/
class FuzzinessValue implements \Magento\Framework\Option\ArrayInterface
{
/**
* {@inheritDoc}
*/
public function toOptionArray()
{
return [
'AUTO' => __('Automatic'),
'1' => 1,
'2' => 2,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@
<label>Enable fuzziness</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="value" translate="label, comment" type="text" sortOrder="20" showInDefault="1" showInContainer="1" showInStore="1">
<field id="value" translate="label, comment" type="select" sortOrder="20" showInDefault="1" showInContainer="1" showInStore="1">
<label>Fuzziness value</label>
<source_model>Smile\ElasticsuiteCore\Model\Config\Source\FuzzinessValue</source_model>
<depends>
<field id="enable_fuzziness">1</field>
</depends>
<!--<validate>validate-digits validate-digits-range validate-zero-or-greater</validate>-->
<comment><![CDATA[Allowed values "0", "1" or "AUTO". See doc <a href='https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html#_parameters_7' target='_blank'>here</a> for more information.]]></comment>
<comment><![CDATA[Allowed values "1", "2" or "AUTO". See doc <a href='https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html#_parameters_7' target='_blank'>here</a> for more information.]]></comment>
</field>
<field id="prefix_length" translate="label, comment" type="text" sortOrder="30" showInDefault="1" showInContainer="1" showInStore="1">
<label>Fuzziness Prefix Length</label>
Expand Down

0 comments on commit b88a60c

Please sign in to comment.