# Elastic4s scala query function\_score

**URL:** <https://discuss.elastic.co/t/elastic4s-scala-query-function-score/20715>\
**Category:** Elasticsearch\
**Created:** [November 12, 2014, 9:15pm UTC](https://discuss.elastic.co/t/elastic4s-scala-query-function-score/20715 "2014-11-12T21:15:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel\_Sciuto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manuel_sciuto/32/1111_2.png) [@Manuel\_Sciuto](https://discuss.elastic.co/u/Manuel_Sciuto)\
**Post date:** [November 12, 2014, 9:15pm UTC](https://discuss.elastic.co/t/elastic4s-scala-query-function-score/20715/1 "2014-11-12T21:15:48Z")

</div>

how I can create the query with client elastic4s scala?

I call using marvel/sense

GET /business/\_search{  
"query": {  
"function\_score": {  
"query": {  
"match": {  
"name": "my text"  
}  
},  
"script\_score": {  
"script": "\_score + log(doc['reviews'].value + 1 )",  
"lang": "groovy"  
}  
}  
},  
"facets": {  
"industry": {  
"terms": {  
"fields": ["type", "industry"]

```
  }
}

```

},  
"size": 10}

But how I can create the query with elastic4s?

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/49654307-03a0-49c1-8441-2a9412a2bbea%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/49654307-03a0-49c1-8441-2a9412a2bbea%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![sksamuel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sksamuel/32/682_2.png) [@sksamuel](https://discuss.elastic.co/u/sksamuel)\
**Post date:** [January 2, 2015, 7:22pm UTC](https://discuss.elastic.co/t/elastic4s-scala-query-function-score/20715/2 "2015-01-02T19:22:27Z")

</div>

> <https://stackoverflow.com/questions/26889255/elastic4s-query-search-function-score>

On Wednesday, November 12, 2014 9:15:49 PM UTC, Manuel Sciuto wrote:

> how I can create the query with client elastic4s scala?
> 
> I call using marvel/sense
> 
> GET /business/\_search{  
> "query": {  
> "function\_score": {  
> "query": {  
> "match": {  
> "name": "my text"  
> }  
> },  
> "script\_score": {  
> "script": "\_score + log(doc['reviews'].value + 1 )",  
> "lang": "groovy"  
> }  
> }  
> },  
> "facets": {  
> "industry": {  
> "terms": {  
> "fields": ["type", "industry"]
> 
> ```
> }
> }
> 
> ```
> 
> },  
> "size": 10}
> 
> But how I can create the query with elastic4s?

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/322090b4-1370-4183-9fc8-adbfd18ea3c9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/322090b4-1370-4183-9fc8-adbfd18ea3c9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:41am UTC](https://discuss.elastic.co/t/elastic4s-scala-query-function-score/20715/3 "2017-07-06T00:41:07Z")

</div>


