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"
}
}
}
}
}