# Php query issue with elasticsearch

**URL:** <https://discuss.elastic.co/t/php-query-issue-with-elasticsearch/144257>\
**Category:** Elasticsearch\
**Created:** [August 13, 2018, 11:26pm UTC](https://discuss.elastic.co/t/php-query-issue-with-elasticsearch/144257 "2018-08-13T23:26:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Realz](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@Realz](https://discuss.elastic.co/u/Realz)\
**Post date:** [August 13, 2018, 11:26pm UTC](https://discuss.elastic.co/t/php-query-issue-with-elasticsearch/144257/1 "2018-08-13T23:26:37Z")

</div>

Hello everyone,

I need some help for a query, there is my query and i will explain my issues below (i work in PHP):

```
$client = ClientBuilder::create()->build();

$params = [
    'index' => 'formations',
    'type' => 'form',
    "from" => 0, "size" => 40,
    "body" => [
        "query" => [
            "bool" => [
                "should" => [
                    "multi_match" => [
                        "type" => "cross_fields",
                        "fields" => ["name", "cities", "sessions"],
                        "query" => '*'.$request->research.'*',
                        "operator" => "OR",
                        "boost" => 3
                    ]
                ]
            ]
        ],
        "highlight" =>[
            "pre_tags" => ['<strong class="text-primary">'],
            "post_tags" => ['</strong>'],
            'fields' => [
                'villes' => new \stdClass(),
            ],
        ]
    ]
];

$response = $client->search($params);

```

When i type the words like 'computer washington', the first result will be those with the empty cities array( the records contains both the word computer and only one contains washington and the other nothing).  
My second issue is to make partial mathing, if i type "informatique" or "l'informatique" it will match both.

i tried to do "query" =\> " \* ".$request-\>research." \* " but its not working 😕

if someone can help me !  
Thanks a lot  
Alex

---

<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:** [September 10, 2018, 11:26pm UTC](https://discuss.elastic.co/t/php-query-issue-with-elasticsearch/144257/2 "2018-09-10T23:26:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
