Pulkitg64 opened a new pull request, #13401:
URL: https://github.com/apache/lucene/pull/13401

   ### Description
   
   This PR is to get feedback on the idea and any major changes required in the 
commit.
   
   In this commit we are using Java SPI instead of ENUM to define 
VectorSimilarityFunction used for vector search. Current implementation in 
Lucene tightly couples ENUM to Lucene index i.e. enum values are directly used 
in field info which are stored in index and later used for reading purpose. 
This makes adding or removing any similarity function to the ENUM very 
difficult as removing any function from ENUM can change the ordinal value of 
the functions and cause mismatch of field while reading fields from the Lucene 
index. On the other hand Java SPI makes life easier by providing pluggable 
implementation of the similarity function. With SPI, we can extend or remove 
similarity function easily without the need for changing things at indexing and 
searching sides.
   
   For backward compatibility, I have kept ordinals with the similarity 
functions which can be directly used for writing/reading fields to/from the 
index. For Lucene version >=10 we can remove ordinal implementation from the 
code and directly use function name for reading/writing the index.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to