Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 2.93 KB

boost-search-results.dotnet.markdown

File metadata and controls

96 lines (62 loc) · 2.93 KB

Boost Search Results


{NOTE: }

{NOTE/}


{PANEL: Boost results - when making a full-text search}

  • When making a full-text search with the Search() method then boosting can be applied
    to both Query and DocumentQuery.

{NOTE: }

{CODE-TABS} {CODE-TAB:csharp:Query boost_1@ClientApi\Session\Querying\TextSearch\BoostResults.cs /} {CODE-TAB:csharp:Query_async boost_2@ClientApi\Session\Querying\TextSearch\BoostResults.cs /} {CODE-TAB:csharp:DocumentQuery boost_3@ClientApi\Session\Querying\TextSearch\BoostResults.cs /} {CODE-TAB-BLOCK:sql:RQL} from "Employees" where search(Notes, "English") or boost(search(Notes, "Italian"), 10) {CODE-TAB-BLOCK/} {CODE-TABS/}

{NOTE/}

{PANEL/}

{PANEL: Boost results - when querying with where clause}

  • When querying with Where clauses (using an OR condition in between) then boosting can be applied
    only with DocuemtQuery.

{NOTE: }

{CODE-TABS} {CODE-TAB:csharp:DocumentQuery boost_4@ClientApi\Session\Querying\TextSearch\BoostResults.cs /} {CODE-TAB:csharp:DocumentQuery_async boost_5@ClientApi\Session\Querying\TextSearch\BoostResults.cs /} {CODE-TAB-BLOCK:sql:RQL} from "Companies" where boost(startsWith(Name, "O"), 10) or boost(startsWith(Name, "P"), 50) or boost(endsWith(Name, "OP"), 90) {CODE-TAB-BLOCK/} {CODE-TABS/}

{NOTE/}

{PANEL/}

{PANEL: Get resulting score}

  • The score can be retrieved by either:

    • Request to include explanations when making the query.
      See include query explanations.

    • Get the metadata of the resulting entities that were loaded to the session.
      See example below.

{NOTE: }

{CODE:csharp boost_6@ClientApi\Session\Querying\TextSearch\BoostResults.cs /}

{NOTE/}

{PANEL/}

Related Articles

Session

Indexes