Grammar and typo fixes (#14019)

This commit is contained in:
Viliam Durina 2024-12-03 17:51:53 +01:00 committed by GitHub
parent df7b1f618d
commit 9c86bed848
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 56 additions and 54 deletions

View File

@ -159,7 +159,7 @@ public class ConcurrentMergeScheduler extends MergeScheduler {
/**
* Sets max merges and threads to proper defaults for rotational or non-rotational storage.
*
* @param spins true to set defaults best for traditional rotatational storage (spinning disks),
* @param spins true to set defaults best for traditional rotational storage (spinning disks),
* else false (e.g. for solid-state disks)
*/
public synchronized void setDefaultMaxMergesAndThreads(boolean spins) {

View File

@ -30,13 +30,13 @@ import org.apache.lucene.util.ThreadInterruptedException;
/**
* {@link DocumentsWriterPerThreadPool} controls {@link DocumentsWriterPerThread} instances and
* their thread assignments during indexing. Each {@link DocumentsWriterPerThread} is once a
* obtained from the pool exclusively used for indexing a single document or list of documents by
* the obtaining thread. Each indexing thread must obtain such a {@link DocumentsWriterPerThread} to
* their thread assignments during indexing. Each {@link DocumentsWriterPerThread} is, once obtained
* from the pool, exclusively used for indexing a single document or list of documents by the
* obtaining thread. Each indexing thread must obtain such a {@link DocumentsWriterPerThread} to
* make progress. Depending on the {@link DocumentsWriterPerThreadPool} implementation {@link
* DocumentsWriterPerThread} assignments might differ from document to document.
*
* <p>Once a {@link DocumentsWriterPerThread} is selected for flush the {@link
* <p>Once a {@link DocumentsWriterPerThread} is selected for flush, the {@link
* DocumentsWriterPerThread} will be checked out of the thread pool and won't be reused for
* indexing. See {@link #checkout(DocumentsWriterPerThread)}.
*/

View File

@ -410,8 +410,8 @@ public class FieldInfos implements Iterable<FieldInfo> {
}
/**
* Returns the global field number for the given field name. If the name does not exist yet it
* tries to add it with the given preferred field number assigned if possible otherwise the
* Returns the global field number for the given field name. If the name does not exist yet, it
* tries to add it with the given preferred field number assigned, if possible, otherwise the
* first unassigned field number is used as the field number.
*/
synchronized int addOrGet(FieldInfo fi) {
@ -550,9 +550,9 @@ public class FieldInfos implements Iterable<FieldInfo> {
}
/**
* This function is called from {@code IndexWriter} to verify if doc values of the field can be
* updated. If the field with this name already exists, we verify that it is doc values only
* field. If the field doesn't exists and the parameter fieldMustExist is false, we create a new
* This function is called from {@link IndexWriter} to verify if doc values of the field can be
* updated. If the field with this name already exists, we verify that it is a doc values-only
* field. If the field doesn't exist and the parameter fieldMustExist is false, we create a new
* field in the global field numbers.
*
* @param fieldName - name of the field

View File

@ -16,6 +16,8 @@
*/
package org.apache.lucene.index;
import org.apache.lucene.search.PhraseQuery;
/**
* Controls how much information is stored in the postings lists.
*
@ -33,7 +35,7 @@ public enum IndexOptions {
DOCS,
/**
* Only documents and term frequencies are indexed: positions are omitted. This enables normal
* scoring, except Phrase and other positional queries will throw an exception.
* scoring, except {@link PhraseQuery} and other positional queries will throw an exception.
*/
DOCS_AND_FREQS,
/**

View File

@ -128,8 +128,8 @@ import org.apache.lucene.util.Version;
* deleted terms won't trigger a segment flush. Note that flushing just moves the internal buffered
* state in IndexWriter into the index, but these changes are not visible to IndexReader until
* either {@link #commit()} or {@link #close} is called. A flush may also trigger one or more
* segment merges which by default run with a background thread so as not to block the addDocument
* calls (see <a href="#mergePolicy">below</a> for changing the {@link MergeScheduler}).
* segment merges, which by default run within a background thread so as not to block the
* addDocument calls (see <a href="#mergePolicy">below</a> for changing the {@link MergeScheduler}).
*
* <p>Opening an <code>IndexWriter</code> creates a lock file for the directory in use. Trying to
* open another <code>IndexWriter</code> on the same directory will lead to a {@link
@ -176,7 +176,7 @@ import org.apache.lucene.util.Version;
* Clarification: Check Points (and commits)
* IndexWriter writes new index files to the directory without writing a new segments_N
* file which references these new files. It also means that the state of
* the in memory SegmentInfos object is different than the most recent
* the in-memory SegmentInfos object is different than the most recent
* segments_N file written to the directory.
*
* Each time the SegmentInfos is changed, and matches the (possibly
@ -190,7 +190,7 @@ import org.apache.lucene.util.Version;
* to delete files that are referenced only by stale checkpoints.
* (files that were created since the last commit, but are no longer
* referenced by the "front" of the index). For this, IndexFileDeleter
* keeps track of the last non commit checkpoint.
* keeps track of the last non-commit checkpoint.
*/
public class IndexWriter
implements Closeable, TwoPhaseCommit, Accountable, MergePolicy.MergeContext {
@ -1088,7 +1088,7 @@ public class IndexWriter
segmentInfos = SegmentInfos.readCommit(directoryOrig, lastSegmentsFile);
if (commit != null) {
// Swap out all segments, but, keep metadata in
// Swap out all segments, but keep metadata in
// SegmentInfos, like version & generation, to
// preserve write-once. This is important if
// readers are open against the future commit
@ -1265,8 +1265,8 @@ public class IndexWriter
}
/**
* Loads or returns the already loaded the global field number map for this {@link SegmentInfos}.
* If this {@link SegmentInfos} has no global field number map the returned instance is empty
* Loads or returns the already loaded global field number map for this {@link SegmentInfos}. If
* this {@link SegmentInfos} has no global field number map, the returned instance is empty.
*/
private FieldNumbers getFieldNumberMap() throws IOException {
final FieldNumbers map =
@ -1840,12 +1840,13 @@ public class IndexWriter
/**
* Expert: Updates a document by first updating the document(s) containing <code>term</code> with
* the given doc-values fields and then adding the new document. The doc-values update and then
* add are atomic as seen by a reader on the same index (flush may happen only after the add).
* the given doc-values fields and then adding the new document. The doc-values update and the
* subsequent addition are atomic, as seen by a reader on the same index (a flush may happen only
* after the addition).
*
* <p>One use of this API is to retain older versions of documents instead of replacing them. The
* existing documents can be updated to reflect they are no longer current while atomically adding
* new documents at the same time.
* existing documents can be updated to reflect they are no longer current, while atomically
* adding new documents at the same time.
*
* <p>In contrast to {@link #updateDocument(Term, Iterable)} this method will not delete documents
* in the index matching the given term but instead update them with the given doc-values fields

View File

@ -62,7 +62,7 @@ public final class IndexWriterConfig extends LiveIndexWriterConfig {
APPEND,
/**
* Creates a new index if one does not exist, otherwise it opens the index and documents will be
* Creates a new index, if one does not exist, otherwise opens the index and documents will be
* appended.
*/
CREATE_OR_APPEND
@ -509,28 +509,28 @@ public final class IndexWriterConfig extends LiveIndexWriterConfig {
}
/**
* Sets the soft deletes field. A soft delete field in lucene is a doc-values field that marks a
* document as soft-deleted if a document has at least one value in that field. If a document is
* marked as soft-deleted the document is treated as if it has been hard-deleted through the
* Sets the soft-deletes field. A soft-delete field in Lucene is a doc-values field that marks a
* document as soft-deleted, if a document has at least one value in that field. If a document is
* marked as soft-deleted, the document is treated as if it has been hard-deleted through the
* IndexWriter API ({@link IndexWriter#deleteDocuments(Term...)}. Merges will reclaim soft-deleted
* as well as hard-deleted documents and index readers obtained from the IndexWriter will reflect
* all deleted documents in it's live docs. If soft-deletes are used documents must be indexed via
* as well as hard-deleted documents, and index readers obtained from the IndexWriter will reflect
* all deleted documents in its live docs. If soft-deletes are used, documents must be indexed via
* {@link IndexWriter#softUpdateDocument(Term, Iterable, Field...)}. Deletes are applied via
* {@link IndexWriter#updateDocValues(Term, Field...)}.
*
* <p>Soft deletes allow to retain documents across merges if the merge policy modifies the live
* docs of a merge reader. {@link SoftDeletesRetentionMergePolicy} for instance allows to specify
* an arbitrary query to mark all documents that should survive the merge. This can be used to for
* example keep all document modifications for a certain time interval or the last N operations if
* some kind of sequence ID is available in the index.
* an arbitrary query to mark all documents that should survive the merge. This can be used, for
* example, to keep all document modifications for a certain time interval or the last N
* operations if some kind of sequence ID is available in the index.
*
* <p>Currently there is no API support to un-delete a soft-deleted document. In oder to un-delete
* the document must be re-indexed using {@link IndexWriter#softUpdateDocument(Term, Iterable,
* Field...)}.
* <p>Currently there is no API support to un-delete a soft-deleted document. In order to
* un-delete a document, it must be re-indexed using {@link IndexWriter#softUpdateDocument(Term,
* Iterable, Field...)}.
*
* <p>The default value for this is <code>null</code> which disables soft-deletes. If soft-deletes
* are enabled documents can still be hard-deleted. Hard-deleted documents will won't considered
* as soft-deleted even if they have a value in the soft-deletes field.
* <p>The default value for this is <code>null</code>, which disables soft-deletes. If
* soft-deletes are enabled, documents can still be hard-deleted. Hard-deleted documents won't be
* considered as soft-deleted even if they have a value in the soft-deletes field.
*
* @see #getSoftDeletesField()
*/

View File

@ -63,7 +63,7 @@ import org.apache.lucene.util.IntBlockPool;
import org.apache.lucene.util.RamUsageEstimator;
import org.apache.lucene.util.Version;
/** Default general purpose indexing chain, which handles indexing all types of fields. */
/** Default general purpose indexing chain, which handles indexing of all types of fields. */
final class IndexingChain implements Accountable {
final Counter bytesUsed = Counter.newCounter();

View File

@ -159,8 +159,8 @@ public class LiveIndexWriterConfig {
* <p>The maximum RAM limit is inherently determined by the JVMs available memory. Yet, an {@link
* IndexWriter} session can consume a significantly larger amount of memory than the given RAM
* limit since this limit is just an indicator when to flush memory resident documents to the
* Directory. Flushes are likely happen concurrently while other threads adding documents to the
* writer. For application stability the available memory in the JVM should be significantly
* Directory. Flushes are likely to happen concurrently while other threads adding documents to
* the writer. For application stability the available memory in the JVM should be significantly
* larger than the RAM buffer used for indexing.
*
* <p><b>NOTE</b>: the account of RAM usage for pending deletions is only approximate.

View File

@ -58,7 +58,7 @@ import java.util.Set;
* (1 GB), and you call {@code forceMerge(10)}, the two settings are clearly in conflict. {@code
* TieredMergePolicy} will choose to break the {@link #setMaxMergedSegmentMB} constraint and try to
* merge down to at most ten segments, each up to 5 * 1.25 GB in size (since an extra 25% buffer
* increase in the expected segment size is targetted).
* increase in the expected segment size is targeted).
*
* <p>findForcedDeletesMerges should never produce segments greater than maxSegmentSize.
*

View File

@ -25,8 +25,8 @@ import java.io.IOException;
public abstract class FSLockFactory extends LockFactory {
/**
* Returns the default locking implementation for this platform. This method currently returns
* always {@link NativeFSLockFactory}.
* Returns the default locking implementation for this platform. This method currently always
* returns {@link NativeFSLockFactory}.
*/
public static final FSLockFactory getDefault() {
return NativeFSLockFactory.INSTANCE;

View File

@ -47,7 +47,7 @@ public class LockStressTest {
+ " verifierPort = port that LockVerifyServer is listening on\n"
+ " lockFactoryClassName = primary FSLockFactory class that we will use\n"
+ " lockDirName = path to the lock directory\n"
+ " sleepTimeMS = milliseconds to pause betweeen each lock obtain/release\n"
+ " sleepTimeMS = milliseconds to pause between each lock obtain/release\n"
+ " count = number of locking tries\n"
+ "\n"
+ "You should run multiple instances of this process, each with its own\n"

View File

@ -61,8 +61,9 @@ public final class NumericUtils {
* Converts a <code>float</code> value to a sortable signed <code>int</code>. The value is
* converted by getting their IEEE 754 floating-point &quot;float format&quot; bit layout and then
* some bits are swapped, to be able to compare the result as int. By this the precision is not
* reduced, but the value can easily used as an int. The sort order (including {@link Float#NaN})
* is defined by {@link Float#compareTo}; {@code NaN} is greater than positive infinity.
* reduced, but the value can easily be used as an int. The sort order (including {@link
* Float#NaN}) is defined by {@link Float#compareTo}; {@code NaN} is greater than positive
* infinity.
*
* @see #sortableIntToFloat
*/

View File

@ -93,21 +93,19 @@ public class NeighborQueue {
/**
* Encodes the node ID and its similarity score as long, preserving the Lucene tie-breaking rule
* that when two scores are equals, the smaller node ID must win.
* that when two scores are equal, the smaller node ID must win.
*
* <p>The most significant 32 bits represent the float score, encoded as a sortable int.
*
* <p>The less significant 32 bits represent the node ID.
* <p>The least significant 32 bits represent the node ID.
*
* <p>The bits representing the node ID are complemented to guarantee the win for the smaller node
* Id.
*
* <p>The AND with 0xFFFFFFFFL (a long with first 32 bit as 1) is necessary to obtain a long that
* has
*
* <p>The most significant 32 bits to 0
*
* <p>The less significant 32 bits represent the node ID.
* <p>The AND with 0xFFFFFFFFL (a long with first 32 bits as 1) is necessary to obtain a long that
* has:
* <li>The most significant 32 bits set to 0
* <li>The least significant 32 bits represent the node ID.
*
* @param node the node ID
* @param score the node score