You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/07/11 07:42:34 UTC

[09/22] lucenenet git commit: lucene-cli: Added Markdown documentation, and extended help text for many commands. Fixed IndexSplitCommand because MultiPassIndexSplitter doesn't make number of segments an optional argument.

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/list-term-info.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/list-term-info.md b/src/tools/lucene-cli/docs/index/list-term-info.md
new file mode 100644
index 0000000..61b97e2
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/list-term-info.md
@@ -0,0 +1,40 @@
+# list-term-info
+
+### Name
+
+`index-list-term-info` - Gets document frequency and total number of occurrences of a term.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index list-term-info <INDEX_DIRECTORY> <FIELD> <TERM> [?|-h|--help]</code>
+
+### Description
+
+Gets document frequency and total number of occurrences (sum of the term frequency for each document) of a term.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index.
+
+`FIELD`
+
+The field to consider.
+
+`TERM`
+
+The term to consider.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+List the term information from the index located at `C:\project-index\`:
+
+<code>dotnet lucene-cli.dll index list-term-info C:\project-index</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/merge.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/merge.md b/src/tools/lucene-cli/docs/index/merge.md
new file mode 100644
index 0000000..98d296f
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/merge.md
@@ -0,0 +1,36 @@
+# merge
+
+### Name
+
+`index-merge` - Merges multiple indexes into a single index.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index merge <OUTPUT_DIRECTORY> <INPUT_DIRECTORY> <INPUT_DIRECTORY_2>[ <INPUT_DIRECTORY_N>...] [?|-h|--help]</code>
+
+### Description
+
+Merges the the input index directories into a combined index at the output directory path.
+
+### Arguments
+
+`OUTPUT_DIRECTORY`
+
+The output directory to merge the input indexes into.
+
+`INPUT_DIRECTORY, INPUT_DIRECTORY_2, INPUT_DIRECTORY_N`
+
+Two or more input index directories, separated by a space.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+Merge the indexes `C:\product-index1` and `C:\product-index2` into an index located at `X:\merged-index`:
+
+<code>dotnet lucene-cli.dll index merge X:\merged-index C:\product-index1 C:\product-index2</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/split.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/split.md b/src/tools/lucene-cli/docs/index/split.md
new file mode 100644
index 0000000..f2343d5
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/split.md
@@ -0,0 +1,54 @@
+# split
+
+### Name
+
+`index-split` - Splits an index into multiple equal parts.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index split <OUTPUT_DIRECTORY> <INPUT_DIRECTORY>[ <INPUT_DIRECTORY_2>...] [-n|--number-of-parts] [-s|--sequential] [?|-h|--help]</code>
+
+### Description
+
+Splits the input index into multiple equal parts. The method employed here uses `IndexWriter.AddIndexes(IndexReader[])` where the input data comes from the input index with artificially applied deletes to the document ids that fall outside the selected partition.
+
+Deletes are only applied to a buffered list of deleted documents and don't affect the source index. This tool works also with read-only indexes.
+
+The disadvantage of this tool is that source index needs to be read as many times as there are parts to be created. The multiple passes may be slow.
+
+> **NOTE:** This tool is unaware of documents added automatically via `IndexWriter.AddDocuments(IEnumerable&lt;IEnumerable&lt;IIndexableField&gt;&gt;, Analyzer)` or `IndexWriter.UpdateDocuments(Term, IEnumerable&lt;IEnumerable&lt;IIndexableField&gt;&gt;, Analyzer)`, which means it can easily break up such document groups.
+
+### Arguments
+
+`OUTPUT_DIRECTORY`
+
+Path to output directory to contain partial indexes.
+
+`INPUT_DIRECTORY, INPUT_DIRECTORY_2`
+
+The path of the source index, which can have deletions and can have multiple segments (or multiple readers). Multiple values can be supplied separated by a space.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-n|--number-of-parts <NUMBER>`
+
+The number of parts (output indices) to produce. If omitted, defaults to 2.
+
+`-s|--sequential`
+
+Sequential doc-id range split (default is round-robin).
+
+### Example
+
+Split the index located at `X:\old-index\` sequentially, placing the resulting 2 indices into the `X:\new-index\` directory:
+
+<code>dotnet lucene-cli.dll index split X:\new-index X:\old-index --sequential</code>
+
+
+Split the index located at `T:\in\` into 4 parts and place them into the `T:\out\` directory:
+
+<code>dotnet lucene-cli.dll index split T:\out T:\in -n 4</code>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/upgrade.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/upgrade.md b/src/tools/lucene-cli/docs/index/upgrade.md
new file mode 100644
index 0000000..20f5861
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/upgrade.md
@@ -0,0 +1,52 @@
+# upgrade
+
+### Name
+
+`index-upgrade` - Upgrades all segments of an index from previous Lucene.Net versions to the current segment file format.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index upgrade [<INDEX_DIRECTORY>] [-d|--delete-prior-commits] [-v|--verbose] [-dir|--directory-type] [?|-h|--help]</code>
+
+### Description
+
+This tool keeps only the last commit in an index; for this reason, if the incoming index has more than one commit, the tool refuses to run by default. Specify --delete-prior-commits to override this, allowing the tool to delete all but the last commit. 
+
+Specify an FSDirectory implementation through the --directory-type option to force its use. If not qualified by an AssemblyName, the Lucene.Net.dll assembly will be used. 
+
+> **WARNING:** This tool may reorder document IDs! Be sure to make a backup of your index before you use this. Also, ensure you are using the correct version of this utility to match your application's version of Lucene.Net. This operation cannot be reversed.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index. If omitted, it defaults to the current working directory.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-d|--delete-prior-commits`
+
+Deletes prior commits.
+
+`-v|--verbose`
+
+Verbose output.
+
+`-dir|--directory-type <DIRECTORY_TYPE>`
+
+The `FSDirectory` implementation to use. Defaults to the optional `FSDirectory` for your OS platform.
+
+### Examples
+
+Upgrade the index format of the index located at `X:\lucene-index\` to the same version as this tool, using the `SimpleFSDirectory` implementation:
+
+<code>dotnet lucene-cli.dll index upgrade X:\lucene-index -dir SimpleFSDirectory</code>
+
+
+Upgrade the index located at `C:\indexes\category-index\` verbosely, deleting all but the last commit:
+
+<code>dotnet lucene-cli.dll index upgrade C:\indexes\category-index --verbose --delete-prior-commits</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/lock/index.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/lock/index.md b/src/tools/lucene-cli/docs/lock/index.md
new file mode 100644
index 0000000..f093377
--- /dev/null
+++ b/src/tools/lucene-cli/docs/lock/index.md
@@ -0,0 +1,10 @@
+# lock
+
+## Description
+
+Utilities for verifying concurrent locking integrity.
+
+## Commands
+
+- [stress-test](stress-test.md)
+- [verify-server](verify-server.md)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/lock/stress-test.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/lock/stress-test.md b/src/tools/lucene-cli/docs/lock/stress-test.md
new file mode 100644
index 0000000..b1d49a5
--- /dev/null
+++ b/src/tools/lucene-cli/docs/lock/stress-test.md
@@ -0,0 +1,55 @@
+# stress-test
+
+### Name
+
+`lock-stress-test` - Simple tool that forever acquires and releases a lock using a specific `LockFactory`.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll lock stress-test <ID> <VERIFIER_HOST> <VERIFIER_PORT> <LOCK_FACTORY_TYPE> <LOCK_DIRECTORY> <SLEEP_TIME_MS> <TRIES> [?|-h|--help]</code>
+
+### Description
+
+You should run multiple instances of this process, each with its own unique ID, and each pointing to the same lock directory, to verify that locking is working correctly. Make sure you are first running [verify-server](verify-server.md).
+
+### Arguments
+
+`ID`
+
+An integer from 0 - 255 (should be unique for test process).
+
+`VERIFIER_HOST`
+
+Hostname or IP address that [verify-server](verify-server.md) is listening on.
+
+`VERIFIER_PORT`
+
+Port that [verify-server](verify-server.md) is listening on.
+
+`LOCK_FACTORY_TYPE`
+
+The primary LockFactory implementation that we will use.
+
+`LOCK_DIRECTORY`
+
+The path to the lock directory (only utilized if `LOCK_FACTORY_TYPE` is set to `SimpleFSLockFactory` or `NativeFSLockFactory`).
+
+`SLEEP_TIME_MS`
+
+Milliseconds to pause between each lock obtain/release.
+
+`TRIES`
+
+Number of locking tries.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+Run the client (stress test), connecting to the server on IP address `127.0.0.4` and port `54464` using the ID 3, the `NativeFSLockFactory`, specifying the lock directory as `F:\temp`, sleep for 50 milliseconds, and try to obtain a lock up to 10 times:
+
+<code>dotnet lucene-cli.dll lock stress-test 3 127.0.0.4 54464 NativeFSLockFactory F:\temp 50 10</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/lock/verify-server.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/lock/verify-server.md b/src/tools/lucene-cli/docs/lock/verify-server.md
new file mode 100644
index 0000000..a34dce1
--- /dev/null
+++ b/src/tools/lucene-cli/docs/lock/verify-server.md
@@ -0,0 +1,35 @@
+# verify-server
+
+### Name
+
+`lock-verify-server` - Server that must be running when you use VerifyingLockFactory (or [stress-test](stress-test.md)).
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll lock verify-server <IP_HOSTNAME> <MAX_CLIENTS> [?|-h|--help]</code>
+
+### Description
+
+This server simply verifies that at most one process holds the lock at a time.
+
+### Arguments
+
+`IP_HOSTNAME`
+
+Hostname or IP address that [verify-server](verify-server.md) will listen on.
+
+`MAX_CLIENTS`
+
+The maximum number of connected clients.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+Run the server on IP `127.0.0.4` with a maximum of 100 connected clients allowed:
+
+<code>dotnet lucene-cli.dll lock verify-server 127.0.0.4 100</code>