- Fix search case

This commit is contained in:
Vincent BRIDIER 2019-12-06 09:49:15 +01:00
parent bad1067b32
commit e38debca7d
2 changed files with 25 additions and 4 deletions

View file

@ -347,7 +347,6 @@ class MediaController extends Controller
break;
}
}else if (strpos($search, '+') !== false){
$search = strtolower(trim($filters->search->value));
$tmpSearch = explode('+', $search);
$mustLib = [];

View file

@ -51,19 +51,30 @@ class Media extends Model
],
'tokenizer' => 'whitespace',
'filter' => [
'word_delimiter'
'lowercase',
'word_delimiter',
],
],
],
'normalizer' => [
'my_normalizer' => [
'type' => 'custom',
'char_filter' => [],
'filter' => [
'lowercase'
]
]
]
],
];
protected $mappingProperties = array(
'libelle' => array(
'type' => 'text',
'analyzer' => 'standard',
'analyzer' => 'default',
'fields' => array(
'keyword' => array(
'type' => 'keyword'
'type' => 'keyword',
'normalizer' => 'my_normalizer'
)
),
'fielddata' => true
@ -87,6 +98,17 @@ class Media extends Model
'articles.noArt' => array(
'type' => 'text',
'analyzer' => 'standard'
),
'articles.libCcial' => array(
'type' => 'text',
'analyzer' => 'default',
'fields' => array(
'keyword' => array(
'type' => 'keyword',
'normalizer' => 'my_normalizer'
)
),
'fielddata' => true
)
);