# FosElasticaBundle edgeNgram filter

**URL:** <https://discuss.elastic.co/t/foselasticabundle-edgengram-filter/18763>\
**Category:** Elasticsearch\
**Created:** [July 21, 2014, 12:03pm UTC](https://discuss.elastic.co/t/foselasticabundle-edgengram-filter/18763 "2014-07-21T12:03:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![milosmoto](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@milosmoto](https://discuss.elastic.co/u/milosmoto)\
**Post date:** [July 21, 2014, 12:03pm UTC](https://discuss.elastic.co/t/foselasticabundle-edgengram-filter/18763/1 "2014-07-21T12:03:19Z")

</div>

Hi I need help I have mapping like this

fos\_elastica:  
clients:  
default: %elastica\_client%  
indexes:  
website:  
settings:  
index:  
analysis:  
analyzer:  
partial\_name:  
type: custom  
tokenizer: standard  
filter: [standard, lowercase, ngram\_name]  
full\_name:  
type: custom  
tokenizer: standard  
filter: [standard, lowercase]  
filter:  
ngram\_name:  
type: "edgeNGram"  
min\_gram: 1  
max\_gram: 10  
client: default  
finder: ~  
types:  
profile:  
mappings:  
username: {type: string, index\_analyzer: partial\_name, search\_analyzer: full\_name }  
email: {type: string,index: not\_analyzed}  
first\_name: {type: string, index\_analyzer: partial\_name, search\_analyzer: full\_name }  
last\_name: {type: string, index\_analyzer: partial\_name, search\_analyzer: full\_name }  
full\_name\_first\_last: {type: string, index\_analyzer: partial\_name, search\_analyzer: partial\_name }  
description: {type: string,index: not\_analyzed}  
country\_id: {type: integer}  
industry\_id: {type: integer}  
category\_id:  
persistence:  
driver: orm  
model: CoreBundle\Entity\Profile  
listener:  
is\_indexable\_callback: isEnabled  
provider:  
query\_builder\_method: findByIsEnabledQueryBuilder  
finder: ~  
elastica\_to\_model\_transformer:  
ignore\_missing: true

So the problem is when I search some string that exist for example:

There is Full name: Michael Smith

and when I search like this: $res = $finder-\>find('Mich\*');

It gives me result but I need to make bool query which doesn't work for me, here is example:

$finder = $this-\>container-\>get('fos\_elastica.finder.website.profile');  
$boolQuery = new Bool();

```
$fieldQuery = new Match();
$fieldQuery->setFieldQuery('username', $user->getUsername());
$boolQuery->addMustNot($fieldQuery);

if(strlen($keyword) > 2){
    // Match content by keyword
    $fieldQuery = new Match();
    $fieldQuery->setFieldQuery('full_name_first_last', 'Mich*');
    $boolQuery->addMust($fieldQuery);
}

```

$result = $finder-\>find($boolQuery);

This doesn't return nothing for me , can anybody help me what can be problem here?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:14am UTC](https://discuss.elastic.co/t/foselasticabundle-edgengram-filter/18763/2 "2017-07-06T01:14:33Z")

</div>


