Knowledge Discovery 25.1
Knowledge Discovery Expert

# Query Weighting in AgentBoolean Queries

See Also: Result Relevance and Ranks

In AgentBoolean queries, you generally do not consider the weighting because the Boolean expressions are designed to either give a match or not. However, in some cases you might want to look at the relevance of the match.

The standard query weighting in Content or Agentstore depends on the terms in your index fields that match the terms in your query text.

In AgentBoolean documents (such as agents and categories), you often set up your index fields to contain the minimum number of terms possible, to improve the performance of the match (see AgentBoolean Query Performance). In this case, you might want to use AgentBoolean weighting, which calculates the relevance according to how well the terms in your AgentBoolean field match the query text.

For example, consider the following AgentBoolean agent:

    #DREREFERENCE Penguin
    #DREFIELD AGENTBOOL="penguin AND Antarctic"
    #DRECONTENT
    Antarctic
    #DREENDDOC

A typical AgentBoolean query provides some document text to match against the agents. A query for Antarctic penguin matches the agent with reasonably high relevance, but as the length of the query text increases, the relevance decreases, because the agent matches only one of the terms.

Instead, you can turn on the `AgentBooleanWeighting` configuration option. In this case, the relevance calculation depends on the number of terms in the AgentBoolean field that match the query text (that is, the relevance is 100% as long as the query contains the terms Antarctic and penguin).

## Use Absolute Weights

In some cases, you might be able to improve conceptual matching by using absolute query weighting, rather than percentage relevance.

With absolute query weighting, the weight is based on how many of the query terms are matched in the result, and how many times they match (the more terms match, the higher the weight). This value is particularly relevant if a query is matching an agent, because the absolute weight reflects the number of matched agent terms.

For example, consider the following three AgentBoolean agents:

    #DREREFERENCE QP
    #DREFIELD AGENTBOOL=""Quantum Physics""
    #DRECONTENT
    Quantum
    #DREENDDOC

    #DREREFERENCE Q
    #DREFIELD AGENTBOOL=""Quantum""
    #DRECONTENT
    Quantum
    #DREENDDOC

    #DREREFERENCE P
    #DREFIELD AGENTBOOL=""Physics""
    #DRECONTENT
    Physics
    #DREENDDOC

The query text Max Planck is considered the father of quantum physics matches all three of these agents.

With standard query weighting, the query matches all three agents with approximately the same weight (with the weight varying according to the APCM weight), because they each match with a single term in the index fields. With `AgentBooleanWeighting` turned on, the query matches all three agents with the same weight, because in each case all the terms in the AgentBoolean field match the query (so they all have 100% relevance).

You can differentiate between these options by using `AgentBooleanWeighting` with absolute weighting (that is, by setting the `AbsWeight` query parameter to true). In this case, the agent `QP` matches the query text with higher relevance because there are more terms in the AgentBoolean field that match.

Copyright 2024 Open Text
Version 25.1 | Last updated January 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery 25.1

Topic Title: Query Weighting in AgentBoolean Queries