Product Selector

Fusion 5.9
    Fusion 5.9

    Chunking Neural Hybrid Query Stage

    The Chunking Neural Hybrid Query stage performs hybrid lexical-semantic search that combines BM25-type lexical search with KNN dense vector search via Solr. This stage differs from the Neural Hybrid Stage because it supports chunking.

    Not sure which hybrid query stage is right for you? Read about the differences between the hybrid query stages.

    This feature is only available in Fusion 5.9.x for versions 5.9.12 and later.

    Click Get Started below to see how to enable chunking in Fusion:

    About the Lexical Query Squash Factor

    The Lexical Query Squash Factor field lets you input a value that squashes the lexical query scores from 0..inf to 0..1. This setting helps prevent the lexical query from dominating the final score, and normalizes the score into a range that works well with vector similarity scores. Additionally, it helps prevent the vanishing gradient problem, which occurs when very high lexical scores are mapped to values extremely close to 1, such as 0.99999999. During the hybrid search calculation, these near-1 values can cause the system to lose sensitivity to subtle differences in lexical relevance, effectively 'squashing' the gradient and reducing the impact of lexical scoring.

    Lucidworks recommends setting the Lexical Query Squash Factor to the inverse of the maximum lexical score observed across your queries. This helps balance the impact of lexical and vector scores, leading to more accurate and nuanced search results.

    Prefiltering

    Prefiltering is a technique that can improve performance and accuracy by filtering documents before applying the algorithm, reducing the number of documents that need to be processed. This is especially effective with the KNN algorithm.

    Prefiltering is disabled by default. To enable it, uncheck Block pre-filtering in this stage.

    When prefiltering is enabled, you can configure the filters using one or both of these methods:

    • Security filters

      You can use security filters as prefilters by placing the Graph Security Trimming Stage after this one in the pipeline. Then Fusion uses the security trimming filter as a prefilter.

    • JavaScript

      When prefiltering is enabled, this stage adds a preFilterKey object to the Javascript ctx object. You can place a Javascript stage after this one and use it to access the preFilterKey object, as in this example:

      if(ctx.hasProperty("preFilterKey")) {
        var preFilter = ctx.getProperty("preFilterKey");
        preFilter.addFilter(filterQuery)
      }

    Configurable vector quantization method

    In Fusion 5.9.13 and up, you can configure the vector quantization method in any LWAI pipeline stage. Quantization converts high-precision float vectors into compact 8-bit integer vectors, significantly lowering storage and compute costs. By default, no quantization is performed; you enable it by selecting a method.

    To select the quantization method, go to Model Configuration in the stage configuration and enter the vectorQuantizationMethod parameter with the value for the desired method:

    Vector quantization method configuration in an LWAI pipeline stage

    Available methods are:

    • min-max creates tensors of embeddings and converts them to uint8 by normalizing them to the range [0, 255].

      This method loses precision when evaluated against non-quantized vectors. Test it against your data to see if the loss is acceptable.

    • max-scale finds the maximum absolute value along each embedding, normalizes the embeddings by scaling them to a range of -127 to 127, and returns the quantized embeddings as an 8-bit integer tensor.

      This method has no loss at the ten-thousandths place during evaluation against non-quantized vectors.

    Configuration

    When entering configuration values in the UI, use unescaped characters, such as \t for the tab character. When entering configuration values in the API, use escaped characters, such as \\t for the tab character.

    Hybrid of Multi-Vector and Lexical Search. Will be skipped if query string is blank or wildcard (* or *:*). Note this will not work well if the incoming q parameter is a Solr query parser string (e.g. field_t:foo) rather than a raw user query string. Note: The resulting query will ALWAYS be written to <request.params.q>.

    skip - boolean

    Set to true to skip this stage.

    Default: false

    label - string

    A unique label for this stage.

    <= 255 characters

    condition - string

    Define a conditional script that must result in true or false. This can be used to determine if the stage should process or not.

    lexicalQuery - stringrequired

    The lexical query itself is retrieved from here. This field supports Template Expressions such as '<request.params.q>' to evaluate the original user query.

    Default: <request.params.q>

    lexicalWeight - numberrequired

    Relative weight of the lexical query. If this value is 0, no re-ranking will be applied using the lexical query scores.

    <= 10

    exclusiveMaximum: false

    Default: 0.1

    lexicalSquash - numberrequired

    The squash factor for the lexical query. This value is used to squash the lexical query scores from 0..inf to 0..1, which can help to prevent the lexical query from dominating the final score. NOTE: A good value here would be the inverse of the lexical maximum score across all queries for the given collection. NOTE: If this value is 0.0, the resulting squashed lexical scores will ALL by 0.0, resulting in lexical recall but vector scoring.

    <= 10

    exclusiveMaximum: false

    Default: 0.1

    vectorQueryField - stringrequired

    The name of the Solr field for knn vector search.

    vector - stringrequired

    The Vector itself is retrieved from here. This field supports Template Expressions such as '<ctx.vector>' to evaluate the context variable resulting from a previous stage, such as the Vectorize Query via Lucidworks AI stage.

    Default: <ctx.vector>

    vectorWeight - numberrequired

    Relative weight of the vector query.

    >= 0.001

    <= 10

    exclusiveMinimum: false

    exclusiveMaximum: false

    Default: 0.9

    minReturnSim - numberrequired

    The minimum vector similarity value to qualify as a match from the Vector portion of the hybrid query.

    <= 1

    exclusiveMaximum: false

    Default: 0.5

    minTraverseSim - numberrequired

    The minimum vector similarity value to use when walking the graph during the Vector portion of the hybrid query. Must be lower than, or equal to, the Min Return Vector Similarity

    <= 1

    exclusiveMaximum: false

    Default: 0.5

    vecSimForLexOnly - boolean

    Compute the vector similarity score for documents that are not in the vector result set but are in the lexical result set.

    Default: true

    vecPreFilterBoolean - boolean

    Checkbox to indicate whether or not to prevent pre-filtering. If checked, preFilter="" will be added to the vector query, which will prevent pre-filtering from being applied to the query.

    Default: true