Examples of addValueToField()


Examples of org.springframework.data.solr.core.query.PartialUpdate.addValueToField()

    toInsert.setPopularity(10);
    solrTemplate.saveBean(toInsert);
    solrTemplate.commit();

    PartialUpdate update = new PartialUpdate("id", DEFAULT_BEAN_ID);
    update.addValueToField("cat", Arrays.asList("spring", "data", "solr"));

    solrTemplate.saveBean(update);
    solrTemplate.commit();

    Assert.assertEquals(1, solrTemplate.count(ALL_DOCUMENTS_QUERY));
View Full Code Here

Examples of org.springframework.data.solr.core.query.PartialUpdate.addValueToField()

  @SuppressWarnings("unchecked")
  @Test
  public void testConvertWhenAddingValue() {
    PartialUpdate update = new PartialUpdate("id", "1");
    update.addValueToField("field_1", "valueToAdd");

    SolrInputDocument document = converter.convert(update);

    Assert.assertTrue(document.getFieldValue("field_1") instanceof Map);
    Assert.assertEquals("valueToAdd", ((Map<String, Object>) document.getFieldValue("field_1")).get("add"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.