Product Selector

Fusion 5.12
    Fusion 5.12

    Configure the LWAI Neural Hybrid Search pipelineLucidworks AI

    The LWAI Neural Hybrid Search pipeline is a default pipeline that contains all the required query stages to set up Neural Hybrid Search using Lucidworks AI.

    This feature is currently only available to clients who have contracted with Lucidworks for features related to Neural Hybrid Search and Lucidworks AI.

    This feature is only available in Fusion 5.9.5 and later versions of Fusion 5.9.

    This pipeline uses the following stages:

    Configure the pipeline

    To add the Neural Hybrid Search (NHS) query pipeline:

    1. Sign in to Fusion and click Querying > Query Pipelines.

    2. Select the default LWAI-neural-hybrid-search-NHS pipeline.

    3. Configure the following stages included in the default pipeline.

    Text Tagger

    The Text Tagger stage queries a Solr text tagger request handler to perform spell correction, phrase boosting, and synonym expansion.

    1. In the Label field, enter a unique identifier for this stage or leave blank to use the default value.

    2. In the Condition field, enter a script that results in true or false, which determines if the stage should process, or leave blank.

    3. In the Tagger Collection field, enter where the tagger request is sent. The default is the query_rewrite collection for the application selected. You must enter a collection with only one shard because Text Tagger does not support multi-shard collections. Template expressions are supported.

    4. In the Param to Tag field, enter a value of q, which is the name of the parameter in the request containing text to tag. This field is ignored on DSL requests.

    5. In the Save Tags in Context field, enter the tags to save in context instead of applying directly to the incoming query in this stage. This enables downstream stages to apply the tags after completing other processing. This field is ignored on DSL requests.

    6. Select the following checkboxes:

      • Spell Correction

      • Phrase Boosting

      • Synonym Expansion

      • Remove Words

      • Tail Rewrites

    7. In the Filter Override field, enter your filter to override filtering for built-in tagger doc types.

    8. In the Original Term Boost for Synonyms field, enter the boost to use for the original term during synonym expansion. For example, 2. To disable this function, enter -1.

    9. In the Default Phrase Boost field, enter the boost to use as a default for phrases that do not have a boost value set. For example, 2. To disable this function, enter -1.

    10. In the Default Phrase Slop field, enter the distance between the terms of the query while still considering it a phrase match. For example, 10.

    11. In the Overlapping Tag Policy field, select the default value of longest_dominant_right to ensure the retained tags have no overlaps. The value is the algorithm that determines which tags in an overlapping set should be retained, versus being pruned away. On DSL requests, this field is ignored so the default value of longest_dominant_right is always used. The available options correspond to Solr Tagger Handler overlaps: all, no_sub, or longest_dominant_right. Setting the value to all or no_sub allows more rewrites to potentially be applied to a query, but can increase the chance of producing undesirable rewrites.

    12. In the Additional Params to be included in the Text Tagger Request section, enter optional values you want to include.

    13. In the Max Wait for Lookup (ms) field, enter the number of milliseconds to wait for the call to the remote tagger collection to return. For example, 500. To disable this function, enter -1.

    14. In the Skip Query Regex field, enter the pattern that identifies queries that are skipped because they contain that pattern. For example, you may want to skip single term queries with wildcards.

    15. Click Save.

    Boost with Signals

    The Boost with Signals stage uses aggregated signals to selectively boost items in the set of search results.

    1. In the Label field, enter a unique identifier for this stage or leave blank to use the default value.

    2. In the Condition field, enter a script that results in true or false, which determines if the stage should process, or leave blank.

    3. Select the Asynchronous Execution Config check box to process this stage asynchronously.

    4. In the Number of Recommendations field, enter the number of documents to return in the query. For example, 10.

    5. In the Number of Signals field, enter the number of signals to process when getting recommended items. For example, 100.

    6. In the Aggregation Type field, enter an applicable value. For example, click@doc_id,filters,query.

    7. In the Solr Field to Boost On field, enter which Solr field to use when applying recommendation boosts. For example, id.

    8. In the Boost Method field, select the boost method to use. If the defType!=edismax for the main query, select query-parser. Another example is query-param.

    9. In the Boost Param field, select one of the following values:

      • boost to multiply scores by the boost values

      • bq to add optional clauses to main query

    10. In the Solr Query parameters section, enter the following Parameter Name:Parameter Value entries:

      • qf: query_t

      • pf: query_t^50

      • pf: query_t-3^20

      • pf2: query_t^20

      • pf2: query_t~3^10

      • pf3: query_t^10

      • pf3: query_t~3^5

      • boost: map(query({!field f=query_s v=$q}),0,0,1,20)

      • mm: 50%

      • defType: edismax

      • sort: score desc, weight_d desc

      • fq: weight_d:[ TO ]

    11. In the Rollup Field, enter the field name to use when rolling up documents that have the same doc id. For example, doc_id_s.

    12. In the Rollup weight field, enter the field name to use for signal weights. For example, weight_d.

    13. In the Rollup weight strategy field, select one of the following methods to use when rolling up the weight:

      • max

      • sum

    14. In the Final Boost Weight Expression field, enter the optional expression to compute the final boost weight using a combination of fields returned by Solr. For example, score and weight_d. Set to weight_d for similar behavior as older versions. Another example is math:log(weight_d + 1) + 10 * math:log(score+1).

    15. In the Document Weights Context Key field, enter the context key in which to save boosts for docId:weight_d.

    16. In the Query Param field, enter the default value of q, which is the name of the parameter in the request containing query to boost.

    17. Select the Include Enriched Query checkbox to:

      • Enable the stage to combine the user’s original query with the output of any stages that enrich the query, such as the Text Tagger stage.

      • Expand the recall of the boost lookup. However, precision may be impacted.

      • Enable the stage to change the configured mm parameter to accommodate additional terms added to the boost lookup query.

    18. In the Update Policy field, select to replace or append the boost parameter in the final query.

    19. Click Save.

    Query Fields

    The Query Fields stage configures query parameters for a Solr search.

    1. In the Label field, enter a unique identifier for this stage or leave blank to use the default value.

    2. In the Condition field, enter a script that results in true or false, which determines if the stage should process, or leave blank.

    3. In the Number of Results field, enter the number of query fields to return. For example, 10.

    4. In the Result Offset field, enter the value that designates the starting position of the first result from the beginning of the data being queried. Offset is zero-based, so a value of 9 counts from 0 through 9 and the first record returned is the 10th record discovered in the query.

    5. In the Results Sort Order section, enter values for the following fields:

      • Sort Type. For example, sort on expression, field, query, or relevancy.

      • Field Name or Expression on which to sort.

      • Sort Order. Select either asc or desc.

    6. In the Search Fields section, enter the field name and boost values to include in this stage.

    7. In the Return Fields section, enter the field names to include in this stage.

    8. Select the Return Score checkbox to set as true and determine if a score is determined for this stage.

    9. In the Minimum Should Match field, enter the minimum string to match for this stage.

    10. Select the Grouping Options checkbox to enter values in the following fields:

      • Grouping Field. The field name on which to group results.

      • Group Size. The number of results per group.

      • Group Sort. Enter values in the following fields:

        • Sort Type. For example, sort on expression, field, query, or relevancy.

        • Field Name or Expression on which to sort.

        • Sort Order. Select either asc or desc.

      • Group Leader Strategy. Select this checkbox to define selection criteria for the representative document from each group. Only one method may be used at a time. Defaults to relevancy if not specified. Values are:

        • By Field Value. If selected, include documents with the minimum or maximum value for the indicated field to be the representative document for each group.

        • By Sort. If selected, include the representative document for each group based on the order in which they are returned with the given sort criteria.

    11. Click Save.

    LWAI Vectorize Query

    The LWAI Vectorize Query stage configures parameters to generate a vector by using a Lucidworks AI (LWAI) embedding model to encode the input to a vector representation. This stage is ignored if the input is blank or a wildcard of either an asterisk (*) or a colon (:) is used.

    1. In the Label field, enter a unique identifier for this stage.

    2. In the Condition field, enter a script that results in true or false, which determines if the stage should process.

    3. In the Account Name field, select the name of the Lucidworks AI account.

    4. In the Model field, select the Lucidworks AI model to use for encoding. For more information, see:

    5. In the Query Input field, enter the location from which the query is retrieved.

    6. In the Output context variable field, enter the name of the variable where the vector value from the response is saved.

    7. In the Use Case Configuration section, click the + sign to enter the parameter name and value to send to Lucidworks AI. The useCaseConfig parameter that is common to embedding use cases is dataType, but each use case may have other parameters. The value for the query stage is query.

    8. The Model Configuration section is not currently available.

    9. Select the Fail on Error checkbox to generate an exception if an error occurs during this stage.

    10. Click Save.

    The Top K setting is set to 100 by default. We recommend leaving this as 100 or setting it to 200.

    This query stage must be placed before the Solr Query stage. For more information, see Reorder Query Pipeline Stages.

    Hybrid Query

    The Hybrid Query stage is a combination of semantic vector search and lexical search. This stage is ignored if the input is blank or a wildcard of either an asterisk (*) or a colon (:).

    In addition, this stage does not function correctly if the incoming q parameter is a Solr query parser string. For example, field_t:foo rather than a raw user query string.

    The resulting query is always written to <request.params.q>.

    1. In the Label field, enter a unique identifier for this stage or leave blank to use the default value.

    2. In the Condition field, enter a script that results in true or false, which determines if the stage should process, or leave blank.

    3. In the Lexical Query Input field, enter the location from which the lexical query is retrieved. For example, <request.params.q>. Template expressions are supported.

    4. In the Lexical Query Weight field, enter the relative weight of the lexical query. For example, 0.3. If this value is 0, no re-ranking will be applied using the lexical query scores.

    5. In the Number of Lexical Results field, enter the number of lexical search results to include in re-ranking. For example, 1000. A value is 0 is ignored.

    6. In the Vector Query Field, enter the name of the Solr field for k-nearest neighbor (KNN) vector search.

    7. In the Vector Input field, enter the location from which the vector is retrieved. Template expressions are supported. For example, a value of <ctx.vector> evaluates the context variable resulting from a previous stage, such as the LWAI Vectorize Query stage.

    8. In the Vector Query Weight field, enter the relative weight of the vector query. For example, 0.7.

    9. Select the Use KNN Query checkbox to use the knn query parser and configure its options. This option cannot be selected if Use VecSim Query checkbox is selected. In addition, Use KNN Query is used if neither Use KNN Query or Use VecSim Query is selected.

      1. If the Use KNN Query checkbox is selected, enter a value in the Number of Vector Results field. For example, 1000.

    10. Select the Use VecSim Query checkbox to use the vecSim query parser and configure its options. This option cannot be selected if Use KNN Query checkbox is selected.

      If the Use VecSim Query checkbox is selected, enter values in the following fields:

      • Min Return Vector Similarity. Enter the minimum vector similarity value to qualify as a match from the Vector portion of the hybrid query.

      • Min Traversal Vector Similarity. Enter the minimum vector similarity value to use when walking through the graph during the Vector portion of the hybrid query. The value must be lower than, or equal to, the value in the Min Return Vector Similarity field.

    11. In the Minimum Vector Similarity Filter, enter the value for a minimum similarity threshold for filtering documents. This option applies to all documents, regardless of other score boosting such as rules or signals.

    12. Click Save.

    Apply Rules

    The Apply Rules stage applies the rules configured in the collection to the query.

    1. In the Label field, enter a unique identifier for this stage or leave blank to use the default value.

    2. In the Condition field, enter a script that results in true or false, which determines if the stage should process, or leave blank.

    3. Select the Asynchronous Execution Config check box to process this stage asynchronously.

    4. In the Collection field, enter the name of the collection that contains the rules. If this field does not contain a value, the default rules collection for the selected application is used. Template expressions are supported.

    5. In the Request Handler field, enter a value of select.

    6. In the HTTP Method field, select POST.

    7. In the Rule Triggering Limit field, enter the maximum number of business rules to be triggered by the query. The default rules matching limit is 100. This configuration overwrites the rows parameter set in Query Parameters section.

    8. In the Query Parameters section, enter the names and values to use when querying the rules collection. If you set the rows parameter here, it will be overwritten by the configuration in the Rule Triggering Limit field.

    9. In the Subquery Rewrite Pipeline id field, enter the value to call a Fusion query pipeline to modify the rule-retrieving subquery. Template expressions are supported.

    10. In the Headers section, enter the names and values to use in this stage.

    11. Select the Use Original Query If No Rules Match checkbox so the stage will try to match rules using the original query (un-tagged) sent into the Text Tagger stage, if available.

    12. Select the Partially Matched Filter Queries Will Trigger the Rule checkbox so the stage will trigger filter rules as long as there is one filter query in the query parameter that matches the filter specified in the rule.

    13. In the Max Wait for Lookup (ms), enter the number of milliseconds to wait for the the call to the remote tagger collection to return. For example, 500. To disable this function, enter -1.

    14. Click Save.

    Solr Query

    The Solr Query stage sends the search request to Solr.

    1. In the Label field, enter a unique identifier for this stage or leave blank to use the default value.

    2. In the Condition field, enter a script that results in true or false, which determines if the stage should process, or leave blank.

    3. In the Configure Request Handlers Allowed for Queries section, enter a value for the request handlers used in this stage.

    4. In the HTTP Method field, select POST.

    5. Select the Allow Federated Search checkbox to enable the use of Solr collection and shards parameters for this stage.

    6. Select the Generate Response Signal checkbox to generate a response signal containing metadata about the response from Solr. Response signals are used by App Insights and experiments. This setting only applies if the searchLogs and signals features are enabled for the collection. To avoid generating response signals as Users type, do not select this option.

    7. In the Exclude Response Signal Criteria section, enter query parameters and Regex patterns to prevent generating a response signal based on specific parameters in the query. For example, use these fields to enable response signals in general, but to disable for auto-complete queries.

    8. In the Preferred Replica Type field, select pull to specify a replicate type that will be given a higher order of precedence when querying Solr. This preference will only be applied for queries that target multiple shards.

    9. Click Save.

    Modify Response with Rules

    The Modify Response with Rules stage modifies the response from Solr using matching rules from the Apply Rules stage.

    1. In the Label field, enter a unique identifier for this stage or leave blank to use the default value.

    2. In the Condition field, enter a script that results in true or false, which determines if the stage should process, or leave blank.

    3. In the Facet Field Label Blob ID, enter the ID for a blob containing labels for facet fields to add to the response.

    4. In the Facet Label Parse Delimiter field, enter || as the delimiter to parse each facet label mapping in the blob. A Java regular expression is also a valid value. Regex must start with ^ and end with $.

    5. Click Save.

    Order the stages

    For the pipeline to operate correctly, the stages must be in the following order:

    When you have ordered the stages, click Save.