# Search Issue - with elasticsearch-mapper-attachments 3.1.2 plugin

**URL:** <https://discuss.elastic.co/t/search-issue-with-elasticsearch-mapper-attachments-3-1-2-plugin/62554>\
**Category:** Elasticsearch\
**Created:** [October 8, 2016, 8:33am UTC](https://discuss.elastic.co/t/search-issue-with-elasticsearch-mapper-attachments-3-1-2-plugin/62554 "2016-10-08T08:33:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yogeshkoli](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@yogeshkoli](https://discuss.elastic.co/u/yogeshkoli)\
**Post date:** [October 8, 2016, 8:33am UTC](https://discuss.elastic.co/t/search-issue-with-elasticsearch-mapper-attachments-3-1-2-plugin/62554/1 "2016-10-08T08:33:37Z")

</div>

Hello,

I am running mapper plugin, I am able to index a document successfully also when I tried to run following search with terminal it works correctly:

curl -X GET 'localhost/test/person/\_search' -d '  
{  
"fields": [],  
"query": {  
"match": {  
"file.content": "king queen"  
}  
},  
"highlight": {  
"fields": {  
"file.content": {  
}  
}  
}  
}'

But the issue is when I am trying to do same thing using PHP curl it showing following output:

{  
"took" : 1,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 2,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "test",  
"\_type" : "person",  
"\_id" : "1",  
"\_score" : 1.0,  
"\_source":{  
"file": "IkdvZCBTYXZlIHRoZSBRdWVlbiIgKGFsdGVybmF0aXZlbHkgIkdvZCBTYXZlIHRoZSBLaW5nIg=="  
}  
}  
]  
}  
}

Here is my PHP code:

\<?php require \_\_DIR\_\_ . '/vendor/autoload.php'; use Curl\Curl; $curl = new Curl(); $data = ["fields" =\> [], "query" =\> ["match" =\> [ "file.content" =\> "king queen"] ], 'highlight' =\> ["fields" =\> [ "file.content" =\> [] ] ] ]; $curl-\>get('localhost:9200/test/person/\_search?pretty=true', json\_encode($data)); echo $curl-\>response; ?\>

is there anything extra we need while accessing it from PHP?

---

<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 5, 2017, 10:13pm UTC](https://discuss.elastic.co/t/search-issue-with-elasticsearch-mapper-attachments-3-1-2-plugin/62554/2 "2017-07-05T22:13:55Z")

</div>


