Я пытаюсь использовать приведенный ниже код для обновления поля в Apache Solr.Но это создает новую запись в документе.
public void потребление (строковое сообщение) выдает SolrServerException, IOException {
System.out.println(message);
Product product = new ObjectMapper().readValue(message, Product.class);
//Preparing the Solr client
String urlString = "http://localhost:8983/solr/product";
SolrClient solrClient = new HttpSolrClient.Builder(urlString).build();
UpdateRequest updateRequest = new UpdateRequest();
updateRequest.setAction(UpdateRequest.ACTION.COMMIT, false, false);
SolrInputDocument myDocumentInstantlycommited = new SolrInputDocument();
myDocumentInstantlycommited.setField("product_id", "42424");
myDocumentInstantlycommited.setField("Price", "566666");
updateRequest.add( myDocumentInstantlycommited);
UpdateResponse rsp = updateRequest.process(solrClient);
System.out.println("Documents Updated");
System.out.println(rsp.getResponse());
}
В этом случае я пытаюсь обновить поле Ценадля которого product_id равен 42424, но он заменяет его новой записью.Спасибо,