コード例 #1
0
  @Test
  public void add_properties_then_index_document_items_created_for_each_property()
      throws Exception {
    RootDataSet rootDataSet = new RootDataSet();
    rootDataSet.addProperty(DataPath.from("a.b.c"), Value.newDouble(2.0));
    rootDataSet.setProperty(DataPath.from("a.b.d"), Value.newLocalDate(LocalDate.now()));

    Node node = Node.newNode().id(EntityId.from("myId")).rootDataSet(rootDataSet).build();

    final Collection<IndexDocument> indexDocuments =
        NodeIndexDocumentFactory.create(node, TEST_WORKSPACE);

    final IndexDocument indexDocument = getIndexDocumentOfType(indexDocuments, IndexType.NODE);

    assertNotNull(
        getItemWithName(indexDocument, IndexDocumentItemPath.from("a_b_c"), IndexValueType.NUMBER));
    assertNotNull(
        getItemWithName(
            indexDocument, IndexDocumentItemPath.from("a_b_d"), IndexValueType.DATETIME));
  }