Skip to content

Commit

Permalink
Add support for reloading the SPI for KnnVectorsFormat class (#13394)
Browse files Browse the repository at this point in the history
Signed-off-by: Navneet Verma <[email protected]>
  • Loading branch information
navneet1v authored and uschindler committed May 27, 2024
1 parent 338f47b commit 8d7bf86
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ Other
* GITHUB#13077: Add public getter for SynonymQuery#field (Andrey Bozhko)


* GITHUB#13393: Add support for reloading the SPI for KnnVectorsFormat class (Navneet Verma)

======================== Lucene 9.10.0 =======================

API Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ public String getName() {
return name;
}

/**
* Reloads the KnnVectorsFormat list from the given {@link ClassLoader}.
*
* <p><b>NOTE:</b> Only new KnnVectorsFormat are added, existing ones are never removed or
* replaced.
*
* <p><em>This method is expensive and should only be called for discovery of new KnnVectorsFormat
* on the given classpath/classloader!</em>
*/
public static void reloadKnnVectorsFormat(ClassLoader classloader) {
Holder.getLoader().reload(classloader);
}

/** looks up a format by name */
public static KnnVectorsFormat forName(String name) {
return Holder.getLoader().lookup(name);
Expand Down

0 comments on commit 8d7bf86

Please sign in to comment.