Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 5, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 5, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 5, 2025

      In MCP era API discoverability is now more important than ever

      June 5, 2025

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025

      Anthropic researchers say next-generation AI models will reduce humans to “meat robots” in a spectrum of crazy futures

      June 5, 2025

      Xbox just quietly added two of the best RPGs of all time to Game Pass

      June 5, 2025

      7 reasons The Division 2 is a game you should be playing in 2025

      June 5, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Mastering TypeScript: How Complex Should Your Types Be?

      June 5, 2025
      Recent

      Mastering TypeScript: How Complex Should Your Types Be?

      June 5, 2025

      IDMC – CDI Best Practices

      June 5, 2025

      PWC-IDMC Migration Gaps

      June 5, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025
      Recent

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025

      Anthropic researchers say next-generation AI models will reduce humans to “meat robots” in a spectrum of crazy futures

      June 5, 2025

      Xbox just quietly added two of the best RPGs of all time to Game Pass

      June 5, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Exact Match Search with Sitecore Search

    Exact Match Search with Sitecore Search

    April 17, 2025

    Searching for content on the web has evolved from basic string based matches to a sophisticated array of approaches including keywords, stemming, synonyms, word order, regular expressions, weights and relevance.  Users expect the highest ranking results to be the most relevant and 75% of users don’t go past the first page of results.  All of these advanced techniques are great to find relevant content.  But sometimes you need to find an exact phrase with the specific words in a specific order.  Many search engines do this by wrapping quote marks around the “search term” to indicate an exact match search. Sitecore Search defaults to relevance based searches, but you can achieve exact match search with some configuration.

    Understanding Sitecore Search

    Let’s take a moment to remember a few concepts in Sitecore Search to understand the configuration better.

    • Index Document – A single piece of indexed content such as a webpage, a word document, a pdf, etc.
    • Attributes – The fields of an indexed document such as title, subtitle, url, content type, etc.
    • Textual Relevance – Defines the attributes used to locate potential results.
    • Weight – Defines a relative value for how important an attribute is within the textual relevance.
    • Analyzers – Convert the original search query into a format that is optimized for search.
    • Token – A chunk of the original search query, usually a single word or phrase that is often modified by the analyzer to include synonyms, remove stop words and reformat to the root word.

    Sitecore Search has a number of predefined analyzers built in.  Each analyzer processes the search query in different ways.

    The default analyzer is the multi local standard analyzer.  This analyzer modifies the search query by making it lower case, splitting the search query into single word tokens, finding the root of each word, applying synonyms, and removing punctuation.  For this reason, it will not find an exact match.  For that we need the keyword analyzer which leaves the search query in a single token without applying any modifications.

    Configure Exact Match Search – Textual Relevance

    In order to configure exact match search, we need to add the keyword analyzer to the textual relevance settings for the desired attribute, in this case the description.

    Navigate to Admin/Domain Settings then click the feature configuration tab.

    Sc Textual Reference A

    Domain Settings

    Edit the Textual Relevance section.

    Sc Textual Referenceb

    Textual Relevance Settings

    Add the keyword analyzer to the description attribute.

    Sc Textual Reference C

    Add Analyzer

    Sc Textual Reference D

    Select the keyword analyzer

    Make sure to save your changes then publish your domain settings for your changes to take effect.

    Configure Exact Match Search – Widget Settings

    Next we need to configure our search widget to use our textual relevance settings.

    Navigate to a widget variation and click add rule.

    Sc Textual Reference 1

    Add rule to a widget Variation

     

    Click the top icon on the left to set the site context.  Add a context rule for Keyword and select the contains option.  In the input box, type a single quote mark.

    Sc Textual Reference 2

    Add keyword rule to the site context

    Click the bottom icon on the left to configure the settings.  Click the tab for Textual Relevance and click the toggle to enable the configuration.  Notice that the description field is listed twice, once for each analyzer. From here you can enable/disable each attribute/analyzer and set its relative weight.  In this example, I’ve set the description-keyword to 3 and the name-multilocal to 1.  This will do the exact match search only on the description attribute.  You could include name-keyword analyzer to do an exact match on the name as well if that is desired.

    Sc Textual Reference 3

    Description keyword rule

    Repeat the process to add or modify a second rule that uses the description-multilocal analyzer.

    Sc Textual Reference 4 Rule2

    Description multilocale rule

    This rule will be the fallback if the search term does not include a quote.

    Sc Textual Reference 5

    Rule order and fallback

    Exact Match Search in Action

    With this configuration in place, you can see the difference in the search results.  In this example, I’ve searched for “proxy statements”.

    When you include a quote mark in the search term, you only get results that have the exact phrase “proxy statements”.  This search returns 12 results.

    Sc Textual Reference B1

    Exact match search with 12 results

    When you do not include the quote mark in the search term, you get results that include proxy, statements and statement.  This search returns 68 results.

    Sc Textual Reference A0

    Relevance search with 68 results

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleUniversal Design in Pharmacies: Key WCAG Principle – Robust
    Next Article Scoping, Hoisting and Temporal Dead Zone in JavaScript

    Related Posts

    Security

    High-Severity Flaw in MIM Medical Imaging Software Allows Code Execution!

    June 5, 2025
    Security

    Amazon Alerts: High-Severity FreeRTOS-Plus-TCP Flaw Needs Immediate Patch!

    June 5, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    studyFlash – learn flashcards in your terminal

    Linux

    Get 23% OFF the ‘SteelSeries Arctis Nova Pro Wireless’ headset for Xbox / PC — arguably the best high-end multi-device headset you can get

    News & Updates

    CVE-2025-43840 – Ref CheckBot CSRF Stored XSS

    Common Vulnerabilities and Exposures (CVEs)

    LaunchDarkly launches Guarded Releases to improve release confidence at every stage of application rollouts

    Development

    Highlights

    Development

    RAGCache: Optimizing Retrieval-Augmented Generation with Dynamic Caching

    November 10, 2024

    Retrieval-Augmented Generation (RAG) has significantly enhanced the capabilities of large language models (LLMs) by incorporating…

    Microsoft’s ‘ultimate goal is to remove passwords completely’ — this overhaul could make it happen

    April 2, 2025

    CVE-2025-48926 – TeleMessage Information Disclosure

    May 28, 2025

    suanPan – finite element method (FEM) simulation platform

    May 22, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.