I'm trying to use script filter with filtered query as given below. The query
execution takes around 20 to 30 secs for 70K matching facet results. How to
speed up the query execution ?

{
  "timeout": 30000,
  "highlight": {
    "pre_tags": [
      ""
    ],
    "post_tags": [
      ""
    ],
    "fields": {
      "srId": {
        "number_of_fragments": 0
      },
      "emails.emailBody": {
        "number_of_fragments": 0
      },
      "chatTextArray.text": {
        "number_of_fragments": 0
      }
    }
  },
  "query": {
    "custom_filters_score": {
      "query": {
        "filtered": {
          "filter": {
            "and": [
              {
                "term": {
                  "domains.L1.domain.id": "1"
                }
              },
              {
                "range": {
                  "closeDt": {
                    "from": 1325404800000,
                    "to": 1390982400000
                  }
                }
              }
            ]
          },
          "query": {
            "query_string": {
              "query": "payment button",
              "default_operator": "AND",
              "fields": [
                [
                  "emails.emailBody",
                  "srId",
                  "chatTextArray.text"
                ]
              ]
            }
          }
        }
      },
      "filters": [
        {
          "filter": {
            "exists": {
              "field": "domains.L1.domain.id"
            }
          },
          "script": "int
docscore=doc['domains.L1.domain.1.prob'].value*1.5;int
expscore=pow(docscore,7);_score=_score*_source._boost*expscore"
        }
      ]
    }
  },
  "size": 10
}



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/script-filter-slow-query-execution-tp4048301.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1390937270853-4048301.post%40n3.nabble.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to