# Unable to find in Java Client API ES 8.7 replacement of fieldsAndWeights in QueryStringQueryBuilder of earlier version

**URL:** https://discuss.elastic.co/t/unable-to-find-in-java-client-api-es-8-7-replacement-of-fieldsandweights-in-querystringquerybuilder-of-earlier-version/336285
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [June 17, 2023, 7:17pm UTC](https://discuss.elastic.co/t/unable-to-find-in-java-client-api-es-8-7-replacement-of-fieldsandweights-in-querystringquerybuilder-of-earlier-version/336285 "2023-06-17T19:17:35Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![ramyogi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramyogi/32/120207_2.png) [@ramyogi](https://discuss.elastic.co/u/ramyogi)
#### Post date: [June 18, 2023, 2:22pm UTC](https://discuss.elastic.co/t/unable-to-find-in-java-client-api-es-8-7-replacement-of-fieldsandweights-in-querystringquerybuilder-of-earlier-version/336285/2 "2023-06-18T14:22:02Z")

</div>

Seems no one responding , i noticed similar request.

> [@Elasticsearch 8.5 Java Client increase field weights during search](https://discuss.elastic.co/t/elasticsearch-8-5-java-client-increase-field-weights-during-search/330408):
>
> Hi! I'm trying to figure out how to boost weights for some of the fields in the index during a search. For instance, I have the name field and I'd like Elasticsearch to give it x2 relevance score. Is it possible to do this with the client? When I used version 7 I had a method /\*\* Add several fields to run the query against with a specific boost. \*/ public SimpleQueryStringBuilder fields(Map\<String, Float\> fields) { Objects.requireNonNull(fields, "fields cannot be null"); …

That also no one responded. So can we not able to get any suggestion from any elastic team experts ? No detailed migration guide for every case i agree but any one share the experience helps a lot.

---

_[View the full topic](https://discuss.elastic.co/t/unable-to-find-in-java-client-api-es-8-7-replacement-of-fieldsandweights-in-querystringquerybuilder-of-earlier-version/336285)._
