MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/uds.cafsinfotech.in/dist/select2/docs/_includes/options/compatibility/matcher.html
<section>
  <h2 id="compat-matcher">
    Simplified function for matching data objects
  </h2>

  <p class="alert alert-info">
    <a href="announcements-4.0.html#new-matcher" class="alert-link">Added in Select2 4.0.0.</a>
    This method was added to make upgrading easier from earlier versions of
    Select2.
  </p>

  <p>
    During the <a href="announcements-4.0.html">Select2 4.0.0 release</a>, the
    <code>matcher</code> function was changed to allow for more complex
    matching of nested objects.
  </p>

  <div class="row">
    <div class="col-sm-6">
      <dl class="dl-horizontal">
        <dt>Key</dt>
        <dd>
          <code>matcher</code>
        </dd>

        <dt>Value</dt>
        <dd>
          A function taking a search <code>term</code> and the data object
          <code>text</code>.
        </dd>
      </dl>
    </div>

    <div class="col-sm-6">
      <dl class="dl-horizontal">
        <dt>Adapter</dt>
        <dd>
          <code title="select2/compat/matcher">oldMatcher</code>
        </dd>
      </dl>
    </div>
  </div>

  <p>
    The <a href="examples.html#matcher">custom matcher example</a> provides a
    guide for how to use this in your own application. For those upgrading
    from older versions of Select2, you just need to wrap your old
    <code>matcher</code> with this function to maintain compatibility.
  </p>
</section>