Is there any way to optimize query in Elasticsearch? I am using below
query. Its taking average 15-20s
and sometimes it little bit fast 4-5s
.
My server configuration :- Centos 6.3, 8 Core 16GB RAM
{
"fields": [
"_id",
"aff_id",
"post_uri",
"blog_cat",
"cat_score",
"secondary_cat",
"secondary_cat_score",
"title",
"_score"
],
"min_score": 0.0134,
"query": {
"bool": {
"must": [
{
"query_string": {
"fields": [
"title"
],
"query": "Archery OR Athletics OR Badminton OR Basketball
OR Beach Volleyball OR Boxing OR Canoe Slalom OR Canoe Sprint OR Cycling
BMX OR Cycling Mountain Bike OR Cycling Road OR Cycling Track OR Diving OR
Equestrian / Dressage OR Equestrian / Eventing OR Equestrian / Jumping OR
Fencing OR Football OR Golf OR Gymnastics Artistic"
}
}
],
"must_not": [],
"should": []
}
}
I read article regarding Elasticsearch query optimization
Tried solution change query like below but doesn't get any difference.
{
"fields": [
"aff_id",
"post_uri",
"blog_cat",
"cat_score",
"secondary_cat",
"secondary_cat_score",
"title"
],
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{
"term": {
"url.cat": "sports"
}
},
{
"range": {
"main_cat.sports": {
"gte": ".15"
}
}
}
]
}
},
"filter": {
"query": {
"query_string": {
"fields": [
"body",
"title"
],
"query": "Archery OR Athletics OR Badminton OR
Basketball OR Beach Volleyball OR Boxing OR Canoe Slalom OR Canoe Sprint OR
Cycling BMX OR Cycling Mountain Bike OR Cycling Road OR Cycling Track OR
Diving OR Equestrian / Dressage OR Equestrian / Eventing OR Equestrian /
Jumping OR Fencing OR Football OR Golf OR Gymnastics Artistic"
}
}
}
}
},
"from": 0,
"size": 1000
}
Any help would be greatly appreciated. Thanks
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/0969654e-f982-4cd3-9990-fa0a2daf303d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.