Skip to content

Commit

Permalink
Extract lucene-index docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaderberg authored and benbc committed Sep 26, 2016
1 parent 4a87a77 commit 8432221
Show file tree
Hide file tree
Showing 13 changed files with 208 additions and 76 deletions.
15 changes: 0 additions & 15 deletions community/lucene-index/pom.xml
Expand Up @@ -125,21 +125,6 @@ the relevant Commercial Agreement.
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-graphviz</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.neo4j.doc</groupId>
<artifactId>neo4j-doc-tools</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>

</dependencies>

<build>
Expand Down
Expand Up @@ -1573,14 +1573,12 @@ public void exactIndexWithCaseInsensitive() throws Exception
@Test
public void exactIndexWithCaseInsensitiveWithBetterConfig() throws Exception
{
// START SNIPPET: exact-case-insensitive
Index<Node> index = graphDb.index().forNodes( "exact-case-insensitive",
stringMap( "type", "exact", "to_lower_case", "true" ) );
Node node = graphDb.createNode();
index.add( node, "name", "Thomas Anderson" );
assertContains( index.query( "name", "\"Thomas Anderson\"" ), node );
assertContains( index.query( "name", "\"thoMas ANDerson\"" ), node );
// END SNIPPET: exact-case-insensitive
restartTx();
assertContains( index.query( "name", "\"Thomas Anderson\"" ), node );
assertContains( index.query( "name", "\"thoMas ANDerson\"" ), node );
Expand Down
30 changes: 15 additions & 15 deletions manual/contents/pom.xml
Expand Up @@ -55,20 +55,6 @@
<classifier>docs</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-lucene-index</artifactId>
<version>${neo4j.version}</version>
<classifier>docs</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-lucene-index</artifactId>
<version>${neo4j.version}</version>
<classifier>test-sources</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ha</artifactId>
Expand Down Expand Up @@ -111,6 +97,20 @@
<classifier>docs</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j.doc</groupId>
<artifactId>neo4j-lucene-index-docs</artifactId>
<version>${neo4j.version}</version>
<classifier>docs</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j.doc</groupId>
<artifactId>neo4j-lucene-index-docs</artifactId>
<version>${neo4j.version}</version>
<classifier>test-sources</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j.doc</groupId>
<artifactId>neo4j-kernel-docs</artifactId>
Expand Down Expand Up @@ -349,7 +349,7 @@
<excludes>META-INF,META-INF/**,org/neo4j/kernel/impl/storemigration/legacystore/**</excludes>
<type>jar</type>
<outputDirectory>${docs.test-sources}</outputDirectory>
<includeArtifactIds>neo4j-cypher-docs,neo4j-examples,neo4j-harness-test,neo4j-server,neo4j-lucene-index,neo4j-backup,neo4j-kernel-docs</includeArtifactIds>
<includeArtifactIds>neo4j-cypher-docs,neo4j-examples,neo4j-harness-test,neo4j-server,neo4j-lucene-index-docs,neo4j-backup,neo4j-kernel-docs</includeArtifactIds>
</configuration>
</execution>
<execution>
Expand Down
4 changes: 2 additions & 2 deletions manual/contents/src/advanced/index.asciidoc
Expand Up @@ -27,13 +27,13 @@ include::{importdir}/neo4j-examples-docs-jar/dev/traversal-framework.asciidoc[]

:leveloffset: 1

include::{importdir}/neo4j-lucene-index-docs-jar/dev/index.asciidoc[]
include::{importdir}/neo4j-lucene-index-docs-docs-jar/dev/index.asciidoc[]

:leveloffset: 1

include::{importdir}/neo4j-kernel-docs-docs-jar/dev/batchinsert.asciidoc[]

:leveloffset: 2

include::{importdir}/neo4j-lucene-index-docs-jar/dev/batchinsertindex.asciidoc[]
include::{importdir}/neo4j-lucene-index-docs-docs-jar/dev/batchinsertindex.asciidoc[]

4 changes: 4 additions & 0 deletions manual/lucene/LICENSES.txt
@@ -0,0 +1,4 @@
This file contains the full license text of the included third party
libraries. For an overview of the licenses see the NOTICE.txt file.


26 changes: 26 additions & 0 deletions manual/lucene/NOTICE.txt
@@ -0,0 +1,26 @@
Neo4j
Copyright © 2002-2016 Network Engine for Objects in Lund AB (referred to
in this notice as "Neo Technology")
[http://neotechnology.com]

This product includes software ("Software") developed by Neo Technology.

The software ("Software") is developed and owned by Network Engine
for Objects in Lund AB (referred to in this notice as "Neo Technology").
If you have executed an End User Software License and Services Agreement,
an OEM Software License and Support Services Agreement, or another
commercial license agreement (including an Evaluation Agreement) with
Neo Technology or one of its affiliates (each, a "Commercial Agreement"),
you may use the Software solely pursuant to the terms of the relevant
Commercial Agreement.

If you have not executed a Commercial Agreement with Neo Technology, the
Software is subject to the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 (http://www.fsf.org/licensing/licenses/agpl-3.0.html), included
in the LICENSE.txt file.

Full license texts are found in LICENSES.txt.

Third-party licenses
--------------------

68 changes: 68 additions & 0 deletions manual/lucene/pom.xml
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>parent</artifactId>
<groupId>org.neo4j</groupId>
<version>3.0.7-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>org.neo4j.doc</groupId>
<artifactId>neo4j-lucene-index-docs</artifactId>
<version>3.0.7-SNAPSHOT</version>

<name>Neo4j - Lucene Index Docs</name>
<description>Documentation build for Neo4j Lucene index integration.</description>


<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-lucene-index</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-lucene-index</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-io</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-graphviz</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j.doc</groupId>
<artifactId>neo4j-doc-tools</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
</dependencies>
</project>
@@ -1,32 +1,33 @@
[[indexing-batchinsert]]
Index Batch Insertion
=====================
= Index Batch Insertion

For general notes on batch insertion, see <<batchinsert>>.

Indexing during batch insertion is done using link:javadocs/org/neo4j/unsafe/batchinsert/BatchInserterIndex.html[BatchInserterIndex] which are provided via link:javadocs/org/neo4j/unsafe/batchinsert/BatchInserterIndexProvider.html[BatchInserterIndexProvider].
An example:

[snippet,java]
[snippet, java]
----
component=neo4j-lucene-index
component=neo4j-lucene-index-docs
source=examples/ImdbDocTest.java
tag=batchInsert
----

The configuration parameters are the same as mentioned in <<indexing-create-advanced>>.

[[indexing-batchinsert-best-practices]]
== Best practices ==
== Best practices

Here are some pointers to get the most performance out of +BatchInserterIndex+:
Here are some pointers to get the most performance out of `BatchInserterIndex`:

* Try to avoid link:javadocs/org/neo4j/unsafe/batchinsert/BatchInserterIndex.html#flush%28%29[flushing] too often because each flush will result in all additions (since last flush) to be visible to the querying methods, and publishing those changes can be a performance penalty.
* Have (as big as possible) phases where one phase is either only writes or only reads, and don't forget to flush after a write phase so that those changes becomes visible to the querying methods.
* Enable link:javadocs/org/neo4j/unsafe/batchinsert/BatchInserterIndex.html#setCacheCapacity%28java.lang.String,%20int%29[caching] for keys you know you're going to do lookups for later on to increase performance significantly (though insertion performance may degrade slightly).
* Enable link:javadocs/org/neo4j/unsafe/batchinsert/BatchInserterIndex.html#setCacheCapacity%28java.lang.String,%20int%29[caching] for keys that you will later do lookups.
This can significantly increase performance (though insertion performance may degrade slightly).

[NOTE]
Changes to the index are available for reading first after they are flushed to disk.
Thus, for optimal performance, read and lookup operations should be kept to a minimum during batchinsertion since they
involve IO and impact speed negatively.
--
Changes to the index are available for reading first after they are flushed to disk.
Thus, for optimal performance, read and lookup operations should be kept to a minimum during batch insertion since they involve IO and impact speed negatively.
--

0 comments on commit 8432221

Please sign in to comment.