<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Search Component exactMatch possible BUG? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1704843#M88481</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;I would like to sort some things out:&lt;BR /&gt;&lt;BR /&gt;Weeks before I found this thread we already faces the problem that a like search was not working.&lt;BR /&gt;We found a hint to use fullText indexes in combination with 'exactMatch = true' to re-enable like-search. That worked, some weeks ago.&lt;BR /&gt;We did not specifically regression test it againg after that.&lt;BR /&gt;We never were more than on JS version behind. Means we were at least at 4.33.&lt;BR /&gt;&lt;BR /&gt;Then, recently, after upgrading to JS 5.0 the like-search stopped working again although we had the indexes.&lt;/P&gt;&lt;P&gt;Before questioning, I would like to define two things:&lt;/P&gt;&lt;P&gt;a) a "like-search" is able to find "est" within "Search Test"&lt;BR /&gt;b) a "any-word-starts-with-search" is only able to find "Tes" withon "Search Test" but not "est"&lt;/P&gt;&lt;P&gt;Now some Questions:&lt;BR /&gt;1) Did sth change regarding this in 5.0? Why did it work then before but not now?&lt;BR /&gt;2) Should using fullText Index still bring the ability to like-search?&lt;BR /&gt;3) May I be mistaken and there never was a "like-search" since 4.25 but only a&amp;nbsp;"any-word-starts-with-search" even using indexes as described in the blog?&lt;BR /&gt;4) Do the indexes described in the blog only apply to AGOL but not to Enterprise Feature Layers?&lt;BR /&gt;5) What is the purpose of exactMatch-attribute then, when it is not supported at all?&lt;BR /&gt;&lt;BR /&gt;Some screenshots, to show what I mean:&lt;BR /&gt;&lt;BR /&gt;It finds "Feld" within "Defi-Feld" but does not find "eld":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_0-1779958738462.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/153137iB5A52A60C24C6703/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_0-1779958738462.png" alt="SebastianKrings_0-1779958738462.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_1-1779958775670.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/153139i502D3A27F76F919B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_1-1779958775670.png" alt="SebastianKrings_1-1779958775670.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Adding a '%' infront does not help:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_2-1779959152184.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/153142iEC9EDF30CA560806/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_2-1779959152184.png" alt="SebastianKrings_2-1779959152184.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The author mentioned that in the comments, but that does not seem to help.&lt;/P&gt;</description>
    <pubDate>Thu, 28 May 2026 09:08:49 GMT</pubDate>
    <dc:creator>SebastianKrings</dc:creator>
    <dc:date>2026-05-28T09:08:49Z</dc:date>
    <item>
      <title>Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685644#M88165</link>
      <description>&lt;P&gt;The search component in 4.34 does not seem to honor exactMatch:False.&amp;nbsp; It will only honor it if the search is in the first characters.&amp;nbsp; Say I am looking for "Driscoll" if I search 'ris' it will not come up, but if I do 'Dri' it will.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In 4.34 the exactMatch: false → prefix only.&amp;nbsp; Where in 4.21 it's like: LIKE '%ris%'&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Wait for your view to be ready
const quickSearch = document.getElementById("quickSearch");
await quickSearch.componentOnReady();

// Assign the map view
quickSearch.view = view;

// Configure only your parcel layer sources
quickSearch.sources = [
  {
    layer: parcelLayer,
    searchFields: ["PartyName_1"],
    name: "Search by Owner",
    exactMatch: false,
    outFields: ["PartyName_1"],
    displayField: "PartyName_1",
    suggestionsEnabled: true,
  },
  {
    layer: parcelLayer,
    searchFields: ["PropertyAddress"],
    name: "Search by Address",
    outFields: ["PropertyAddress"],
    displayField: "PropertyAddress",
    exactMatch: false,
  },
  {
    layer: parcelLayer,
    searchFields: ["QuickRefID_1"],
    name: "Search by Quick Reference ID",
    outFields: ["QuickRefID_1"],
    displayField: "QuickRefID_1",
    exactMatch: false,
  }
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2026 21:07:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685644#M88165</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2026-02-20T21:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685808#M88173</link>
      <description>&lt;P&gt;Following this. Not sure if this is related, but we have noticed few differences as well. It seems that Search in ExP works differently to Search in Map SDK. For example, when I search "Nora", below are the results I have obtained from Search widget in Map SDK and Search widget from ExP Builder.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Search result for "Nora" in Map SDK Search widget -&amp;nbsp;&lt;A href="https://imgur.com/a/XWumpC0" target="_blank"&gt;https://imgur.com/a/XWumpC0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Search result for "Nora" in ExP Search widget -&amp;nbsp;&lt;A href="https://imgur.com/a/sPxLVy6" target="_blank"&gt;https://imgur.com/a/sPxLVy6&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The results seem different regardless of the setting. In the ExP builder, we can see the results include the search term being in the middle of the result whereas in the Map SDK version, it always displays the start's with results.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Feb 2026 23:02:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685808#M88173</guid>
      <dc:creator>NZGIS</dc:creator>
      <dc:date>2026-02-22T23:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685938#M88177</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/327152"&gt;@MatthewDriscoll&lt;/a&gt;&amp;nbsp;This is the expected behavior. The change was introduced in 4.25:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/4.25/#search-performance-improvements" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/4.25/#search-performance-improvements&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This AGOL blog also gives additional insights into why this change may have occurred:&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/searching-for-features-in-maps-and-apps" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/searching-for-features-in-maps-and-apps&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 17:14:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685938#M88177</guid>
      <dc:creator>WesleyO</dc:creator>
      <dc:date>2026-02-23T17:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685940#M88178</link>
      <description>&lt;P&gt;Is there a known fix or do I go create my own?&amp;nbsp; Seems like it makes this component pretty useless for anything other then location.&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/973671"&gt;@NZGIS&lt;/a&gt;&amp;nbsp; this is directly related to your problem, it is prefix only now.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 17:17:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685940#M88178</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2026-02-23T17:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685944#M88179</link>
      <description>&lt;P&gt;I am not aware of any ways to adjust this through the API. However, adding "%" to the front of your search term should do the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/973671"&gt;@NZGIS&lt;/a&gt;&amp;nbsp;,&amp;nbsp;This feature exists in ExB's Search Widget, but only as a search result rather than a search suggestion. Let me know if there are any questions on this.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 17:24:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685944#M88179</guid>
      <dc:creator>WesleyO</dc:creator>
      <dc:date>2026-02-23T17:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685952#M88180</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/search-component-exactmatch-bring-back-full-text/idi-p/1685947/jump-to/first-unread-message" target="_self"&gt;Idea thread found here.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Solution:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Configure only your parcel layer sources
// Custom getSuggestions bypasses Esri's 5.0 prefix-only behavior
// and restores the old LIKE '%value%' contains search
quickSearch.sources = [
  {
    layer: parcelLayer,
    searchFields: ["PartyName_1"],
    displayField: "PartyName_1",
    name: "Search by Owner",
    outFields: ["PartyName_1"],
    exactMatch: false,
    suggestionsEnabled: true,
    getSuggestions: (params) =&amp;gt; {
      const query = parcelLayer.createQuery();
      query.where = `PartyName_1 LIKE '%${params.suggestTerm.replace(/'/g, "''")}%'`;
      query.outFields = ["PartyName_1"];
      query.returnGeometry = false;
      query.returnDistinctValues = true;
      query.orderByFields = ["PartyName_1"];
      query.num = 6;
      return parcelLayer.queryFeatures(query).then(results =&amp;gt; {
        return results.features.map(f =&amp;gt; ({
          key: f.attributes.PartyName_1,
          text: f.attributes.PartyName_1,
          sourceIndex: params.sourceIndex
        }));
      });
    }
  },
  {
    layer: parcelLayer,
    searchFields: ["PropertyAddress"],
    displayField: "PropertyAddress",
    name: "Search by Address",
    outFields: ["PropertyAddress"],
    exactMatch: false,
    suggestionsEnabled: true,
    getSuggestions: (params) =&amp;gt; {
      const query = parcelLayer.createQuery();
      query.where = `PropertyAddress LIKE '%${params.suggestTerm.replace(/'/g, "''")}%'`;
      query.outFields = ["PropertyAddress"];
      query.returnGeometry = false;
      query.returnDistinctValues = true;
      query.orderByFields = ["PropertyAddress"];
      query.num = 6;
      return parcelLayer.queryFeatures(query).then(results =&amp;gt; {
        return results.features.map(f =&amp;gt; ({
          key: f.attributes.PropertyAddress,
          text: f.attributes.PropertyAddress,
          sourceIndex: params.sourceIndex
        }));
      });
    }
  },
  {
    layer: parcelLayer,
    searchFields: ["QuickRefID_1"],
    displayField: "QuickRefID_1",
    name: "Search by Quick Reference ID",
    outFields: ["QuickRefID_1"],
    exactMatch: false,
    suggestionsEnabled: true,
    getSuggestions: (params) =&amp;gt; {
      const query = parcelLayer.createQuery();
      query.where = `QuickRefID_1 LIKE '%${params.suggestTerm.replace(/'/g, "''")}%'`;
      query.outFields = ["QuickRefID_1"];
      query.returnGeometry = false;
      query.returnDistinctValues = true;
      query.orderByFields = ["QuickRefID_1"];
      query.num = 6;
      return parcelLayer.queryFeatures(query).then(results =&amp;gt; {
        return results.features.map(f =&amp;gt; ({
          key: f.attributes.QuickRefID_1,
          text: f.attributes.QuickRefID_1,
          sourceIndex: params.sourceIndex
        }));
      });
    }
  }
];&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 02 Mar 2026 19:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1685952#M88180</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2026-03-02T19:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1703734#M88470</link>
      <description>&lt;P&gt;this works very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of using hard coded num 6 I guess you can read the effective maxSuggestions from the params.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;query.num = params.maxSuggestions;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We also am using multiple fields as search fields I need to map them for the whereclause.&lt;BR /&gt;Additionally I put them as outFields and orderByFields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/**
 * Creates a suggestion callback that restores contains-style matching for all configured search fields.
 * &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/891663"&gt;@Param&lt;/a&gt; layer Feature layer queried for suggestions
 * &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/891663"&gt;@Param&lt;/a&gt; searchFields Fields that are searched using LIKE '%term%'
 * &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/891663"&gt;@Param&lt;/a&gt; displayField Preferred field used for sorting and suggestion display
 */
private createContainsSuggestions(
    layer: FeatureLayer,
    searchFields: string[],
    displayField?: string | null
): NonNullable&amp;lt;LayerSearchSourceProperties['getSuggestions']&amp;gt; {
    return async (params) =&amp;gt; {
        const suggestTerm = params.suggestTerm?.trim();
        if (!suggestTerm) {
            return [];
        }

        const escapedTerm = this.escapeSqlStringLiteral(suggestTerm);
        const query = layer.createQuery();
        query.where = searchFields
            .map(searchField =&amp;gt; `${searchField} LIKE '%${escapedTerm}%'`)
            .join(' OR ');
        query.outFields = searchFields;
        query.returnGeometry = false;
        query.returnDistinctValues = true;
        query.orderByFields = searchFields;
        if (typeof params.maxSuggestions === 'number') {
            query.num = params.maxSuggestions;
        }

        const result = await layer.queryFeatures(query);
        return result.features.flatMap(feature =&amp;gt; {
            const textValue = displayField ? feature.attributes?.[displayField] : undefined;
            if (!textValue) {
                return [];
            }

            return [{
                key: textValue,
                text: textValue,
                sourceIndex: params.sourceIndex
            }];
        });
    };
}

/**
 * Escapes single quotes for safe use in SQL string literals.
 * &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/891663"&gt;@Param&lt;/a&gt; value Raw user-provided search value
 */
private escapeSqlStringLiteral(value: string): string {
    return value.replace(/'/g, "''");
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 May 2026 08:53:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1703734#M88470</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2026-05-22T08:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1704166#M88475</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/327152"&gt;@MatthewDriscoll&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;&lt;P&gt;this solution only works for the suggestionList right?&lt;BR /&gt;How do we enable it for the actual search as well after hitting enter?&lt;BR /&gt;&lt;BR /&gt;This is, what is sent to server:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;query?f=pbf
     &amp;amp;fullText=[{"onFields":["search_names"],"searchTerm":"Defi","searchType":"prefix"}]
     &amp;amp;maxAllowableOffset=1
     &amp;amp;resultRecordCount=6
     &amp;amp;where=1=1
     &amp;amp;outFields=*
     &amp;amp;outSR=102100
     &amp;amp;spatialRel=esriSpatialRelIntersects&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we apply a "like" here?&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2026 14:05:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1704166#M88475</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2026-05-25T14:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1704169#M88476</link>
      <description>&lt;P&gt;I solved that by creating an interceptor looking for searchTerm and replacing it with a where clause.&lt;BR /&gt;This works for the actual search and the suggestionList as well.&lt;/P&gt;&lt;P&gt;I also added a LOWER to the like clause to support case insensitivity.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;interface FullTextSearchExpression {
    onFields?: string[];
    searchTerm?: string;
    searchOperator?: 'and' | 'or';
}

interface MutableQuery extends Record&amp;lt;string, any&amp;gt; {
    where?: unknown;
    fullText?: unknown;
}

/**
 * Registers an ArcGIS query interceptor that maps fullText search terms to SQL LIKE where clauses.
 * @return void
 */
private interceptQueryRequests(): void {
    const queryInterceptor: RequestInterceptor = {
        urls: '/\\/query\\/?(?:\\?.*)?$/i',
        before: (params) =&amp;gt; {
            const query = params.requestOptions.query;
            if (!query || query instanceof URLSearchParams || typeof query !== 'object') {
                return;
            }

            const mutableQuery = query as MutableQuery;

            const fullTextExpressions = this.parseFullTextExpressions(mutableQuery.fullText);
            if (!fullTextExpressions.length) {
                return;
            }

            const fullTextWhereClause = this.createFullTextWhereClause(fullTextExpressions);
            if (!fullTextWhereClause) {
                return;
            }

            mutableQuery.where = this.mergeWhereClauses(mutableQuery.where, fullTextWhereClause);
            delete mutableQuery.fullText;
        }
    };

    esriConfig.request.interceptors?.push(queryInterceptor);
}

/**
 * Parses fullText request payload to a list of search expressions.
 * &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/891663"&gt;@Param&lt;/a&gt; fullText Full text payload from query parameters
 * @return Parsed expressions or empty array when payload is invalid
 */
private parseFullTextExpressions(fullText: unknown): FullTextSearchExpression[] {
    if (!fullText) {
        return [];
    }

    if (Array.isArray(fullText)) {
        return fullText.filter((item): item is FullTextSearchExpression =&amp;gt; typeof item === 'object' &amp;amp;&amp;amp; item !== null);
    }

    if (typeof fullText === 'string') {
        try {
            const parsed = JSON.parse(fullText);
            return Array.isArray(parsed)
                ? parsed.filter((item): item is FullTextSearchExpression =&amp;gt; typeof item === 'object' &amp;amp;&amp;amp; item !== null)
                : [];
        } catch {
            return [];
        }
    }

    return [];
}

/**
 * Builds SQL where clauses from fullText expressions using LIKE with contains wildcards.
 * &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/891663"&gt;@Param&lt;/a&gt; expressions Full text expressions to transform
 * @return SQL where fragment or undefined if no valid conditions can be generated
 */
private createFullTextWhereClause(expressions: FullTextSearchExpression[]): string | undefined {
    const clauses: string[] = [];

    for (let index = 0; index &amp;lt; expressions.length; index++) {
        const expression = expressions[index];
        const fields = expression.onFields?.filter(field =&amp;gt; field &amp;amp;&amp;amp; field !== '*') ?? [];
        const rawTerm = expression.searchTerm?.trim();

        if (!fields.length || !rawTerm) {
            continue;
        }

        const termWithWildcards = this.ensureContainsWildcard(rawTerm);
        const escapedTerm = this.escapeSqlStringLiteral(termWithWildcards);
        const fieldClause = fields
            .map(field =&amp;gt; `LOWER(${field}) LIKE LOWER('${escapedTerm}')`)
            .join(' OR ');

        if (!fieldClause) {
            continue;
        }

        if (!clauses.length) {
            clauses.push(fieldClause);
            continue;
        }

        const previousOperator = expressions[index - 1]?.searchOperator?.toUpperCase() === 'OR' ? 'OR' : 'AND';
        clauses.push(`${previousOperator} ${fieldClause}`);
    }

    if (!clauses.length) {
        return undefined;
    }

    return clauses.join(' ');
}

/**
 * Ensures a term uses contains-style wildcards unless they are already present.
 * &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/891663"&gt;@Param&lt;/a&gt; term Search term
 * @return Term wrapped with % wildcard markers
 */
private ensureContainsWildcard(term: string): string {
    let wildcardTerm = term;
    if (!wildcardTerm.startsWith('%')) {
        wildcardTerm = `%${wildcardTerm}`;
    }
    if (!wildcardTerm.endsWith('%')) {
        wildcardTerm = `${wildcardTerm}%`;
    }

    return wildcardTerm;
}

/**
 * Merges an existing where clause with an additional one.
 * &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/891663"&gt;@Param&lt;/a&gt; existingWhere Existing where value
 * &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/891663"&gt;@Param&lt;/a&gt; additionalWhere Additional where clause to append
 * @return Combined where clause
 */
private mergeWhereClauses(existingWhere: unknown, additionalWhere: string): string {
    const normalizedExisting = typeof existingWhere === 'string' ? existingWhere.trim() : '';
    if (!normalizedExisting) {
        return additionalWhere;
    }

    return `${normalizedExisting} AND ${additionalWhere}`;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2026 16:23:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1704169#M88476</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2026-05-25T16:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Search Component exactMatch possible BUG?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1704843#M88481</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;I would like to sort some things out:&lt;BR /&gt;&lt;BR /&gt;Weeks before I found this thread we already faces the problem that a like search was not working.&lt;BR /&gt;We found a hint to use fullText indexes in combination with 'exactMatch = true' to re-enable like-search. That worked, some weeks ago.&lt;BR /&gt;We did not specifically regression test it againg after that.&lt;BR /&gt;We never were more than on JS version behind. Means we were at least at 4.33.&lt;BR /&gt;&lt;BR /&gt;Then, recently, after upgrading to JS 5.0 the like-search stopped working again although we had the indexes.&lt;/P&gt;&lt;P&gt;Before questioning, I would like to define two things:&lt;/P&gt;&lt;P&gt;a) a "like-search" is able to find "est" within "Search Test"&lt;BR /&gt;b) a "any-word-starts-with-search" is only able to find "Tes" withon "Search Test" but not "est"&lt;/P&gt;&lt;P&gt;Now some Questions:&lt;BR /&gt;1) Did sth change regarding this in 5.0? Why did it work then before but not now?&lt;BR /&gt;2) Should using fullText Index still bring the ability to like-search?&lt;BR /&gt;3) May I be mistaken and there never was a "like-search" since 4.25 but only a&amp;nbsp;"any-word-starts-with-search" even using indexes as described in the blog?&lt;BR /&gt;4) Do the indexes described in the blog only apply to AGOL but not to Enterprise Feature Layers?&lt;BR /&gt;5) What is the purpose of exactMatch-attribute then, when it is not supported at all?&lt;BR /&gt;&lt;BR /&gt;Some screenshots, to show what I mean:&lt;BR /&gt;&lt;BR /&gt;It finds "Feld" within "Defi-Feld" but does not find "eld":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_0-1779958738462.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/153137iB5A52A60C24C6703/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_0-1779958738462.png" alt="SebastianKrings_0-1779958738462.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_1-1779958775670.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/153139i502D3A27F76F919B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_1-1779958775670.png" alt="SebastianKrings_1-1779958775670.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Adding a '%' infront does not help:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_2-1779959152184.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/153142iEC9EDF30CA560806/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_2-1779959152184.png" alt="SebastianKrings_2-1779959152184.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The author mentioned that in the comments, but that does not seem to help.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2026 09:08:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-component-exactmatch-possible-bug/m-p/1704843#M88481</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2026-05-28T09:08:49Z</dc:date>
    </item>
  </channel>
</rss>

