# Searching slow on Linux

**URL:** <https://discuss.elastic.co/t/searching-slow-on-linux/90340>\
**Category:** Elasticsearch\
**Created:** [June 21, 2017, 5:56pm UTC](https://discuss.elastic.co/t/searching-slow-on-linux/90340 "2017-06-21T17:56:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![munotshubham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/munotshubham/32/22663_2.png) [@munotshubham](https://discuss.elastic.co/u/munotshubham)\
**Post date:** [June 21, 2017, 5:56pm UTC](https://discuss.elastic.co/t/searching-slow-on-linux/90340/1 "2017-06-21T17:56:24Z")

</div>

Hi,

So I've indexed around 50k documents in a linux machine and a windows machine.  
I am just firing one query using Node.js which is like

```
client.search({
        index: 'patientdb-test',
        type: 'db',
        body: {
            explain: "true",
            size: 100,
            query: {
                bool: {
                    must: [
                        {
                            multi_match: {
                                query: req.params.word,
                                fields: ["FirstName", "LastName", "PreferredName", "DateOfBirth", "PMRecordNumber"],
                                type: "cross_fields"
                            }
                        }
                    ],
                    filter: {
                        term: {
                            "PracticeID.keyword": req.params.pid
                        }
                    }
                }
            }
        }
    }).then(function (resp) {
        var hits = resp.hits.hits;
        res.send(hits);
    }, function (err) {
        console.trace(err.message);
    });

```

It is taking around 1-2 seconds on the Linux Machine.  
It is taking around 20-100 milliseconds on the Windows Machine

Settings and Mappings:  
PUT patientdb-test  
{  
"settings": {  
"analysis": {  
"analyzer": {  
"autocomplete": {  
"tokenizer": "autocomplete",  
"filter": [  
"lowercase"  
]  
},  
"autocomplete\_search": {  
"tokenizer": "whitespace"  
}  
},  
"tokenizer": {  
"autocomplete": {  
"type": "edge\_ngram",  
"min\_gram": 1,  
"max\_gram": 10,  
"token\_chars": [  
"letter","digit","symbol","whitespace","punctuation"  
]  
}  
}  
}  
},  
"mappings": {  
"db": {  
"properties": {  
"FirstName": {  
"type": "text",  
"analyzer": "autocomplete",  
"search\_analyzer": "autocomplete\_search"  
},  
"LastName": {  
"type": "text",  
"analyzer": "autocomplete",  
"search\_analyzer": "autocomplete\_search"  
},  
"PreferredName": {  
"type": "text",  
"analyzer": "autocomplete",  
"search\_analyzer": "autocomplete\_search"  
},  
"DateOfBirth": {  
"type": "text",  
"analyzer": "autocomplete",  
"search\_analyzer": "autocomplete\_search"  
},  
"PMRecordNumber": {  
"type": "text",  
"analyzer": "autocomplete",  
"search\_analyzer": "autocomplete\_search"  
}  
}  
}  
}  
}

---

<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 19, 2017, 5:56pm UTC](https://discuss.elastic.co/t/searching-slow-on-linux/90340/2 "2017-07-19T17:56:39Z")

</div>

Closed on July 19, 2017, 5:56pm UTC

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