# Create\_weight takes too long

**URL:** <https://discuss.elastic.co/t/create-weight-takes-too-long/211093>\
**Category:** Elasticsearch\
**Created:** [December 9, 2019, 10:48am UTC](https://discuss.elastic.co/t/create-weight-takes-too-long/211093 "2019-12-09T10:48:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenyiping111](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@chenyiping111](https://discuss.elastic.co/u/chenyiping111)\
**Post date:** [December 9, 2019, 10:48am UTC](https://discuss.elastic.co/t/create-weight-takes-too-long/211093/1 "2019-12-09T10:48:29Z")

</div>

when i use query to search, the profile API show me the each TermQuery search time, the time of create\_weight takes 90%. I use shingle (2 words, 3 words), is that makes term dictionary too large? Any suggest can help?

my search:  
{  
"profile": true,  
"\_source": [  
"id"  
],  
"from": 0,  
"query": {  
"function\_score": {  
"boost\_mode": "multiply",  
"functions": [  
{  
"script\_score": {  
"script": {  
"lang": "expression",  
"source": "1 + sqrt(doc['n\_citation'].value/100)"  
}  
}  
}  
],  
"query": {  
"bool": {  
"must\_not": [  
{  
"term": {  
"is\_deleted": true  
}  
}  
],  
"filter": ,  
"must": {  
"dis\_max": {  
"queries": [  
{  
"multi\_match": {  
"type": "best\_fields",  
"tie\_breaker": 0.2,  
"fields": [  
"title",  
"keywords",  
"authors.name",  
"venue.raw"  
],  
"query": "Socio economic Risks of Atypical Employment Relationships: Evidence from the German Labour Market"  
}  
}  
],  
"tie\_breaker": 0  
}  
}  
}  
}  
}  
},  
"size": 20  
}

some profile:

- "time\_in\_nanos": 5999371167,
- "breakdown": {
  - "set\_min\_competitive\_score\_count": 0,
  - "match\_count": 0,
  - "shallow\_advance\_count": 0,
  - "set\_min\_competitive\_score": 0,
  - "next\_doc": 6391125,
  - "match": 0,
  - "next\_doc\_count": 26434,
  - "score\_count": 26434,
  - "compute\_max\_score\_count": 0,
  - "compute\_max\_score": 0,
  - "advance": 298333781,
  - "advance\_count": 19,
  - "score": 25916575,
  - "build\_scorer\_count": 38,
  - "create\_weight": 5615225195,
  - "shallow\_advance": 0,
  - "create\_weight\_count": 1,
  - "build\_scorer": 53451565},

---

<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:** [January 6, 2020, 10:48am UTC](https://discuss.elastic.co/t/create-weight-takes-too-long/211093/2 "2020-01-06T10:48:40Z")

</div>

Closed on January 6, 2020, 10:48am UTC

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