Class Neo4jCommitter

All Implemented Interfaces:
IBatchConsumer, ICommitter, IXMLConfigurable, AutoCloseable

public class Neo4jCommitter extends AbstractBatchCommitter

Commit documents/fields to a Neo4j graph database.

Authentication

Basic authentication is supported for password-protected Solr installations.

XML configuration usage:


<committer
    class="com.norconex.committer.neo4j.Neo4jCommitter">
  <!--
    Mandatory settings --->
       <uri>
         (Required connection URI. E.g., "bolt://localhost:7687".)
       </uri>
       <upsertCypher>
         (Cypher query for adding relationships to Neo4j. Typically,
         you want to use MERGE and the "nodeIdProperty" value to update
         existing entries matching the ID. In order to delete all nodes
         related to an entry, make sure to add the ID property on all
         appropriate nodes.
         The query parameters correspond the document fields.)
       </upsertCypher>
       <deleteCypher>
         (Cypher query for adding relationships to Neo4j. Typically,
         you want to use "nodeIdProperty" value to delete nodes having
         a matching property value. The query parameters correspond the
         document fields.)
       </deleteCypher>

       <!-- Optional settings --->
       <database>
         (A database name when using one other than the default one.)
       </database>
       <credentials>

       </credentials>
       <multiValuesJoiner>
         (One or more characters to join multi-value fields. Default is "|".)

       </multiValuesJoiner>
       <nodeIdProperty>
         (Optional property name where to store the document reference
         in Neo4j graph entries.  Use it as a cypher parameter to uniquely
         identify your graph entries in your configured "upsertCypher" and
         "deleteCypher" queries. Default is "id".)
       </nodeIdProperty>
       <nodeContentProperty>
         (Optional property name where to store the document content
         in Neo4j graph entries.  Use it as a cypher parameter
         in your configured "upsertCypher" query. Default is "content".)
       </nodeContentProperty>
       <optionalParameters>
         (Comma-separated list of parameter names that can be missing when
         creating the query. They will be set to {@link NullValue}) to avoid

         client exception for missing parameters.)
       <optionalParameters>



     </committ
    -->

XML usage example:


<committer
    class="com.norconex.committer.neo4j.Neo4jCommitter">
  <uri>bolt://localhost:7687</uri>
  <upsertCypher>
    MERGE (a:Document { docId: $id })
    SET a += { title: $title }
    SET a += { author: $author }
  </upsertCypher>
  <deleteCypher>
    MATCH (a:Document { docId: $id })
    DETACH DELETE a
  </deleteCypher>
  <credentials>
    <username>neo4j</username>
    <password>AcwFJPHITfk6LrRp7HW7Ag6hvDZotXcvWt2WvDMcGIo=</password>
    <passwordKey>
      <value>key.txt</value>
      <source>file</source>
    </passwordKey>
  </credentials>
  <multiValuesJoiner>_</multiValuesJoiner>
</committer>

The above example creates a graph of collected documents.

Author:
Sylvain Roussy, Pascal Essiembre