Class AbstractQueryVectorBuilderTestCase<T extends QueryVectorBuilder>

Type Parameters:
T - the query vector builder type to test

public abstract class AbstractQueryVectorBuilderTestCase<T extends QueryVectorBuilder> extends AbstractXContentSerializingTestCase<T>
Tests a query vector builder
  • Constructor Details

    • AbstractQueryVectorBuilderTestCase

      public AbstractQueryVectorBuilderTestCase()
  • Method Details

    • additionalPlugins

      protected List<SearchPlugin> additionalPlugins()
    • registerNamedXContents

      public void registerNamedXContents()
    • xContentRegistry

      protected org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry()
      Description copied from class: ESTestCase
      The NamedXContentRegistry to use for this test. Subclasses should override and use liberally.
      Overrides:
      xContentRegistry in class ESTestCase
    • getNamedWriteableRegistry

      protected NamedWriteableRegistry getNamedWriteableRegistry()
      Description copied from class: AbstractWireTestCase
      Get the NamedWriteableRegistry to use when de-serializing the object. Override this method if you need to register NamedWriteables for the test object to de-serialize. By default this will return a NamedWriteableRegistry with no registered NamedWriteables
      Overrides:
      getNamedWriteableRegistry in class AbstractWireTestCase<T extends QueryVectorBuilder>
    • createTestInstance

      protected T createTestInstance(float[] expected)
    • testKnnSearchBuilderXContent

      public final void testKnnSearchBuilderXContent() throws Exception
      Throws:
      Exception
    • testKnnSearchBuilderWireSerialization

      public final void testKnnSearchBuilderWireSerialization() throws IOException
      Throws:
      IOException
    • testKnnSearchRewrite

      public final void testKnnSearchRewrite() throws Exception
      Throws:
      Exception
    • testVectorFetch

      public final void testVectorFetch() throws Exception
      Throws:
      Exception
    • doAssertClientRequest

      protected abstract void doAssertClientRequest(ActionRequest request, T builder)
      Assert that the client action request is correct given this provided random builder
      Parameters:
      request - The built request to be executed by the client
      builder - The builder used when generating this request
    • createResponse

      protected abstract ActionResponse createResponse(float[] array, T builder)
      Create a response given this expected array that is acceptable to the query builder
      Parameters:
      array - The expected final array
      builder - The original randomly built query vector builder
      Returns:
      An action response to be handled by the query vector builder
    • randomVector

      protected static float[] randomVector(int dim)