set_function

The function set_function(score_function_filename, collection_name, function_name) sets a score function as part of Lexical Search or Hybrid Search. This function is mandatory for these search types.

Input -

  • score_function_filename – Specifies the name and path of the file containing the logic to be used in the search query, which is described in step #1 above. This loads the contents of this file to a local object.

  • collection_name – Specifies the name of the Collection that contains the data to be searched.

  • function_name – Assigns the score function a local object name to be used later when running the search query.

Example-

hyperspace_client.set_function(score_function_filename,
                               collection_name=collection_name,
                               function_name='score_function')

The set_function module is optimized for performance. When repeatedly with recurring value of function_name, the set_function module compares the new score function with the previously set one and will only be activated if the two are not identical.

Last updated

#108: Max's Nov 6 changes

Change request updated