# Boosting both by FIELD names and TERM PROXIMITY is possible with ES (similar to EDISMAX in SOLR)?

**URL:** <https://discuss.elastic.co/t/boosting-both-by-field-names-and-term-proximity-is-possible-with-es-similar-to-edismax-in-solr/16854>\
**Category:** Elasticsearch\
**Created:** [April 7, 2014, 6:10pm UTC](https://discuss.elastic.co/t/boosting-both-by-field-names-and-term-proximity-is-possible-with-es-similar-to-edismax-in-solr/16854 "2014-04-07T18:10:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niccolo\_Becchi](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@Niccolo\_Becchi](https://discuss.elastic.co/u/Niccolo_Becchi)\
**Post date:** [April 7, 2014, 6:10pm UTC](https://discuss.elastic.co/t/boosting-both-by-field-names-and-term-proximity-is-possible-with-es-similar-to-edismax-in-solr/16854/1 "2014-04-07T18:10:17Z")

</div>

Is there anyway to configure a query in a similar way as edismax in SOLR  
that's taking care about term proximity and boosting by fields?  
I have spend days but actually I haven't found any good solution with  
elasticsearch

That's an example of edismax in SOLR (  
[http://wiki.apache.org/solr/ExtendedDisMax](http://wiki.apache.org/solr/ExtendedDisMax) ):

```
params.set("q", "london market bonds");
params.set("qf", "subject title^5");
params.set("pf", "subject^10 title^50");
params.set("ps", "10");
params.set("pf2", "subject^5 title^25");
params.set("ps2", "20");
params.set("mm", "2");
params.set("tie", "0.8");

```

It's translated in the following Lucene query:

+(  
(  
(title:london^5.0 | subject:london)~0.8  
(title:market^5.0 | subject:market)~0.8  
(title:bonds^5.0 | subject:bond)~0.8  
)  
~2  
)  
(subject:"london market bond"~10^10.0)~0.8  
(title:"london market bonds"~10^50.0)~0.8  
(  
(subject:"london market"~20^5.0)~0.8  
(subject:"market bond"~20^5.0)~0.8  
)  
(  
(title:"london market"~20^25.0)~0.8  
(title:"market bonds"~20^25.0)~0.8  
)

With the new Multiple query strings in elasticsearch 1.1 (  
[http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/multi-query-strings.html](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/multi-query-strings.html)  
) you can do something similar, but you have no control on the terms  
proximity.  
So, looking for two terms, there is no difference if the two terms are far.  
But this feature is too important if you are looking for example for a  
person with a query like "Michael Johnson".

Thanks  
Niccolo

--  
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/07c187f6-a0d4-4b52-8931-6b4941fe44c9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/07c187f6-a0d4-4b52-8931-6b4941fe44c9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [April 9, 2014, 5:55pm UTC](https://discuss.elastic.co/t/boosting-both-by-field-names-and-term-proximity-is-possible-with-es-similar-to-edismax-in-solr/16854/2 "2014-04-09T17:55:56Z")

</div>

Just a thought, I'm wondering if you can just build a bool query with  
multiple should clauses and just boost each clause. And then I would  
imagine 1 bool clause will do the proximity query (span) like you describe  
above, and then another clause will do the multi\_match. Maybe?

--  
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/2971fbdc-b837-4e16-9b41-4345efa09670%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2971fbdc-b837-4e16-9b41-4345efa09670%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, 1:37am UTC](https://discuss.elastic.co/t/boosting-both-by-field-names-and-term-proximity-is-possible-with-es-similar-to-edismax-in-solr/16854/3 "2017-07-06T01:37:09Z")

</div>


