Recently I tried to search some BT seed data on ES, which has about two million data.I want to full text search the name and path field.
Here is my mapping:
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 2,
"refresh_interval": "30s",
"index.store.preload": [
"nvd",
"dvd",
"tim",
"doc",
"dim"
]
},
"mappings": {
"common": {
"dynamic": false,
"properties": {
"path_all": {
"type": "text"
},
"name": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
},
"length": {
"type": "long"
},
"popularity": {
"type": "integer"
},
"create_time": {
"type": "date",
"format": "epoch_millis"
},
"files": {
"properties": {
"length": {
"type": "long"
},
"path": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word",
"copy_to": "path_all"
}
}
}
}
}
}
}
I tried the following query on kibana:
POST torrent_info/common/_search
{
"from": 0,
"size": 10,
"sort": [
{
"_score": "desc"
},
{
"length": "desc"
},
{
"popularity": "desc"
},
{
"create_time": "desc"
}
],
"query": {
"multi_match": {
"query": "mp3",
"fields": [
"name",
"path_all"
]
}
},
"highlight": {
"pre_tags": [
"<strong>"
],
"post_tags": [
"</strong>"
],
"fields": {
"name": {}
}
}
}
I allocated 4G memory to ES,but I found that the average retrieval speed was above 1s, sometimes more than 1s.
I hope someone can help me with 2 questions below:
- Is there anything I can improve in my configuration, mapping?
- Is it a good choice to use es on windows?