Question: This is my code: 

```
@Controller
@RequestMapping("/")
public class MerchantsController {

    @Autowired
    MerchantsService merchantsService;

    @Autowired
    ProductsService productsService;

    @Autowired
    OrdersService ordersService;

    @RequestMapping(value = "/merchants", method = RequestMethod.GET)
    public ModelAndView showMerchantsList() {
        ModelAndView modelAndView = new ModelAndView("merchantsList");
        List<Merchant> merchants = merchantsService.getMerchantsList();
        for (Merchant merchant : merchants) {
            if(merchant.getOrder_type() == OrderType.NO_ORDERING){
                merchant.setOrderUntil(Time.valueOf("00:00:00"));
            }
        }
        modelAndView.addObject("merchants", merchants);
        return modelAndView;
    }

```

As I understand when I send request to localhost:8080/ it should open localhost:8080/merchants, but it is not working. Anyone has any suggestions?

Answer: 
The best way I've found to update a single nested field is to use the elasticsearch update API that takes a (parameterised) script a la [this answer](https://stackoverflow.com/questions/18360225/elastic-search-is-it-possible-to-update-nested-objects-without-updating-the-ent). Last time I checked this kind of thing is only supported in groovy scripts, not lucene expression scripts (unfortunately). The reason your update produces the result it does is you are updating the whole nested object, not a specific nested item. Groovy script update will allow you to select and update the nested object with the specified ID.
You can also have a look at the nested object that I have currently updated and how I used the UpdateRequest class in Java [here](https://stackoverflow.com/questions/23363801/update-nested-field-in-an-index-of-elasticsearch-with-java-api/36983040#36983040).

Specifically for the JAVA API, it is also possible to update a nested document with this [answer](https://stackoverflow.com/questions/35728236/how-to-update-nested-objects-in-elasticsearch-2-2-script-via-java-api/37072836#37072836) of PeteyPabPro.