mirror of
https://github.com/apache/lucene.git
synced 2025-03-06 16:29:30 +00:00
Edit HNSW API docs (#13688)
* Edit HNSW API docs for clarity, readability, punctuation, etc. Co-authored-by: pierwill <pierwill@users.noreply.github.com>
This commit is contained in:
parent
3e3a7db1db
commit
054295fd38
@ -51,9 +51,9 @@ import org.apache.lucene.util.hnsw.HnswGraphBuilder;
|
||||
* <li><b>array[vint]</b> the delta encoded neighbor ordinals
|
||||
* </ul>
|
||||
* </ul>
|
||||
* <li>After all levels are encoded memory offsets for each node's neighbor nodes encoded by
|
||||
* {@link org.apache.lucene.util.packed.DirectMonotonicWriter} are appended to the end of the
|
||||
* file.
|
||||
* <li>After all levels are encoded, memory offsets for each node's neighbor nodes are appended to
|
||||
* the end of the file. The offsets are encoded by {@link
|
||||
* org.apache.lucene.util.packed.DirectMonotonicWriter}.
|
||||
* </ul>
|
||||
*
|
||||
* <h2>.vem (vector metadata) file</h2>
|
||||
@ -101,9 +101,9 @@ public final class Lucene99HnswVectorsFormat extends KnnVectorsFormat {
|
||||
public static final int DEFAULT_MAX_CONN = HnswGraphBuilder.DEFAULT_MAX_CONN;
|
||||
|
||||
/**
|
||||
* The maximum size of the queue to maintain while searching during graph construction This
|
||||
* maximum value preserves the ratio of the DEFAULT_BEAM_WIDTH/DEFAULT_MAX_CONN i.e. `6.25 * 16 =
|
||||
* 3200`
|
||||
* The maximum size of the queue to maintain while searching during graph construction. This
|
||||
* maximum value preserves the ratio of the `DEFAULT_BEAM_WIDTH`/`DEFAULT_MAX_CONN` (i.e. `6.25 *
|
||||
* 16 = 3200`).
|
||||
*/
|
||||
public static final int MAXIMUM_BEAM_WIDTH = 3200;
|
||||
|
||||
@ -130,7 +130,7 @@ public final class Lucene99HnswVectorsFormat extends KnnVectorsFormat {
|
||||
*/
|
||||
private final int beamWidth;
|
||||
|
||||
/** The format for storing, reading, merging vectors on disk */
|
||||
/** The format for storing, reading, and merging vectors on disk. */
|
||||
private static final FlatVectorsFormat flatVectorsFormat =
|
||||
new Lucene99FlatVectorsFormat(FlatVectorScorerUtil.getLucene99FlatVectorsScorer());
|
||||
|
||||
|
@ -68,7 +68,7 @@ public abstract class HnswGraph {
|
||||
/** Returns the number of nodes in the graph */
|
||||
public abstract int size();
|
||||
|
||||
/** Returns max node id, inclusive, normally this value will be size - 1 */
|
||||
/** Returns max node id, inclusive. Normally this value will be size - 1. */
|
||||
public int maxNodeId() {
|
||||
return size() - 1;
|
||||
}
|
||||
@ -130,7 +130,7 @@ public abstract class HnswGraph {
|
||||
};
|
||||
|
||||
/**
|
||||
* Iterator over the graph nodes on a certain level, Iterator also provides the size – the total
|
||||
* Iterator over the graph nodes on a certain level. Iterator also provides the size – the total
|
||||
* number of nodes to be iterated over. The nodes are NOT guaranteed to be presented in any
|
||||
* particular order.
|
||||
*/
|
||||
|
@ -67,8 +67,8 @@ public class HnswUtil {
|
||||
/**
|
||||
* Returns the sizes of the distinct graph components on the given level. The forest starting at
|
||||
* the entry points (nodes in the next highest level) is considered as a single component. If the
|
||||
* entire graph is rooted in the entry points, that is every node is reachable from at least one
|
||||
* entry point, the returned list will have a single entry. If the graph is empty, the returned
|
||||
* entire graph is rooted in the entry points--that is, every node is reachable from at least one
|
||||
* entry point--the returned list will have a single entry. If the graph is empty, the returned
|
||||
* list will be empty.
|
||||
*/
|
||||
static List<Integer> componentSizes(HnswGraph hnsw, int level) throws IOException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user