# Search Definitions

> Browse PeopleSoft Search Framework search definitions: source query, search attributes, security, deployment and index history, and Real-Time Indexing.

---

Site [llms.txt](/llms.txt)

---

<div id="pslens-context-panel" class="card border-info mb-4 d-none">
  <div class="card-header bg-light text-info py-2 fw-bold d-flex align-items-center border-bottom border-info-subtle">
    <i class="bi bi-info-circle-fill me-2"></i>
    <span>Tailored Operational Context</span>
  </div>
  <div class="card-body p-0">
    <ul class="list-group list-group-flush">
      <li id="row-db" class="list-group-item d-flex align-items-center justify-content-between py-2 d-none">
        <strong>Target Database:</strong>
        <span id="ctx-db" class="badge bg-secondary font-monospace">&mdash;</span>
      </li>
      <li id="row-type" class="list-group-item d-flex align-items-center justify-content-between py-2 d-none">
        <strong>Context Type:</strong>
        <span id="ctx-type" class="badge bg-light text-dark border font-monospace text-uppercase">&mdash;</span>
      </li>
      <li id="row-severity" class="list-group-item d-flex align-items-center justify-content-between py-2 d-none">
        <strong>Alert Severity:</strong>
        <span id="ctx-severity" class="badge">&mdash;</span>
      </li>
      <li id="row-time" class="list-group-item d-flex align-items-center justify-content-between py-2 d-none">
        <strong>Triggered Time:</strong>
        <span id="ctx-time" class="text-muted small">&mdash;</span>
      </li>
      <li id="row-details" class="list-group-item py-2 d-none">
        <strong id="label-details" class="d-block mb-1">Firing Context:</strong>
        <code id="ctx-details" class="d-block p-2 bg-light border rounded small"
          style="white-space: pre-wrap; word-break: break-all;">&mdash;</code>
      </li>
      <li id="row-sql" class="list-group-item py-2 d-none">
        <div class="d-flex justify-content-between align-items-center mb-1">
          <strong id="label-sql">Contextual SQL:</strong>
          <button id="btn-copy-sql" type="button" class="btn btn-sm btn-outline-secondary py-0 px-2 small">
            <i class="bi bi-clipboard me-1"></i>Copy SQL
          </button>
        </div>
        <pre class="mb-0 p-2 bg-light border rounded small"><code id="ctx-sql" style="white-space: pre-wrap; word-break: break-word;">&mdash;</code></pre>
      </li>
    </ul>
  </div>
</div>

<script>
  (function () {
    const params = new URLSearchParams(window.location.search);
    const metadata = params.get('metadata');
    if (!metadata) return;

    try {
      
      const base64 = metadata.replace(/-/g, '+').replace(/_/g, '/');
      const jsonStr = decodeURIComponent(escape(window.atob(base64)));
      const data = JSON.parse(jsonStr);

      if (data) {
        let hasData = false;

        if (data.db) {
          document.getElementById('ctx-db').textContent = data.db;
          document.getElementById('row-db').classList.remove('d-none');
          hasData = true;
        }

        if (data.type) {
          document.getElementById('ctx-type').textContent = data.type;
          document.getElementById('row-type').classList.remove('d-none');
          hasData = true;
        }

        if (data.severity) {
          const severityBadge = document.getElementById('ctx-severity');
          const severity = data.severity.toLowerCase();
          severityBadge.textContent = severity.toUpperCase();
          if (severity === 'critical') {
            severityBadge.className = 'badge bg-danger';
          } else if (severity === 'warning') {
            severityBadge.className = 'badge bg-warning text-dark';
          } else {
            severityBadge.className = 'badge bg-info';
          }
          document.getElementById('row-severity').classList.remove('d-none');
          hasData = true;
        }

        if (data.t) {
          const date = new Date(data.t * 1000);
          document.getElementById('ctx-time').textContent = date.toLocaleString();
          document.getElementById('row-time').classList.remove('d-none');
          hasData = true;
        }

        if (data.details) {
          document.getElementById('ctx-details').textContent = data.details;

          
          const labelDetails = document.getElementById('label-details');
          if (data.type === 'object') {
            labelDetails.textContent = 'Object Metadata Details:';
          } else if (data.type === 'report') {
            labelDetails.textContent = 'Report Description:';
          } else {
            labelDetails.textContent = 'Firing Context:';
          }

          document.getElementById('row-details').classList.remove('d-none');
          hasData = true;
        }

        if (data.sql) {
          document.getElementById('ctx-sql').textContent = data.sql;
          document.getElementById('row-sql').classList.remove('d-none');
          const copyBtn = document.getElementById('btn-copy-sql');
          if (copyBtn && navigator.clipboard) {
            copyBtn.addEventListener('click', function () {
              navigator.clipboard.writeText(data.sql).then(function () {
                copyBtn.innerHTML = '<i class="bi bi-check2 me-1"></i>Copied';
                setTimeout(function () {
                  copyBtn.innerHTML = '<i class="bi bi-clipboard me-1"></i>Copy SQL';
                }, 2000);
              });
            });
          }
          hasData = true;
        }

        if (hasData) {
          document.getElementById('pslens-context-panel').classList.remove('d-none');
        }
      }
    } catch (e) {
      console.error('Failed to parse operational context metadata:', e);
    }
  })();
</script>

Search definitions (`PSPTSF_SD`) are the PeopleSoft Search Framework objects that map a PS Query or connected query to the fields stored in an OpenSearch or Elasticsearch index.

psLens shows the definition header, its field-to-attribute mappings from `PSPTSF_SD_ATTR`, and the search categories it belongs to. Five related-data panels add security, record and component mappings, deployment and index history, Real-Time Indexing, and project membership.

## Object Relationships

- **Reads from a query**: `PTSF_SOURCE_TYPE` is `Q` for a PS Query or `C` for a connected query, and `PTSF_SOURCE_NAME` holds its name. A connected-query definition lists its member queries in `PSPTSF_SD_ATTR.QRYNAME`.
- **Maps query fields to search attributes**: each row of `PSPTSF_SD_ATTR` ties a query field to an attribute in the catalog `PSPTSF_ATTRS` and flags it as indexed, faceted, or displayed.
- **Belongs to search categories**: `PSPTSF_SRCCATAT` lists the [search categories](/docs/objects/search-categories/) that include the definition.
- **Calls Application Engine programs**: optional pre-processing, post-processing, and data partitioning programs run around the index build.
- **Secured by an application class or an access list**: document-level security names a class in `PSPTSF_SD_DCACL`. Source-level security lists roles and users in `PSPTSF_SD_SRACL`.

## How psLens Improves Search Definition Inspection

In PIA, a search definition's mappings, security, and advanced settings are on separate tabs of the Search Definition component. Deployment status and index build history are on other Search Framework administration pages, and Real-Time Indexing settings are on another.

psLens puts the definition, its attribute mappings, its security, its deployment and build history, and its Real-Time Indexing trigger records on one page, with links to the queries, records, Application Engine programs, and application packages it names.

## Search Page

URL: `/searchdefinitions?db={database}`

<figure><img src="/images/screenshots/metadata/search-definitions-search.png"
			alt="Search definition search results showing PTPORTALREGISTRY, PTSEARCHREPORTS, and PTSF_INSIGHTS"><figcaption>
			<p>Search definition search results for <code>PT%</code></p>
		</figcaption>
</figure>


- **Search:** matches the definition name as *starts with*, and the description as *contains*. Include `%` yourself for other patterns (`%HRS%`), or use `%` alone to list every definition.
- **Filters:** last updated operator, last updated date range, and customized definitions only.
- **Result cards:** each card shows the definition name, the source type (Query, Connected Query, File Source, Web Source), a **Global** badge when the definition is in Global Search, the description, the source name, and last-updated metadata.

## Detail Page

URL: `/searchdefinitions/{SDNAME}?db={database}`

<figure><img src="/images/screenshots/metadata/search-definitions-detail.png"
			alt="Search definition detail page for PTPORTALREGISTRY showing its properties and the Related Data sidebar"><figcaption>
			<p>Search definition detail page for <code>PTPORTALREGISTRY</code></p>
		</figcaption>
</figure>


- **Search Definition Properties:** source type and source name (linked to the query), delete query, pre-processing, post-processing, and data partitioning Application Engine programs with their sections, staging record and temp table, security mode badges (Document-Level, Source-Level, Security Join Disabled), Global Search flag, custom application class, object owner, and last-updated metadata.
- **Search Categories:** every category that lists the definition (`PSPTSF_SRCCATAT`), each linked to its detail page.
- **Search Attributes:** one row per mapped query field (`PSPTSF_SD_ATTR`) with the attribute name, query, query field, the record and field behind that query field, and the Indexed, Faceted, Display, Attachment, and Clustered flags.
  - **Record and Field** come from the query's field list (`PSQRYFIELD`). The record links to its detail page and the field links to its where-used page, so you can trace an indexed attribute back to the table it reads.
  - A query expression shows **Expression**. A dash means the query field is no longer in the query: the PeopleTools 8.62 demo database has two such leftovers on `PTPORTALREGISTRY`.
- **Open Search Definition in PeopleSoft:** opens the definition in Search Designer.
- **Export as Markdown:** exports the definition and whichever panels are switched on.

A search definition has no active or inactive status in PeopleSoft. Whether it is in use is shown by the Deployment & Index History panel.

## Related Data Panels

Each panel reads optional tables. When a table is not whitelisted the panel names it instead of failing. When a table has more rows than psLens reads at once, the panel says the list is incomplete. The tables are listed under Search Framework in [Whitelist Tables](/docs/getting-started/whitelist-tables/).

### Security & Access Control

- **Document Security Filter Application Class** (`PSPTSF_SD_DCACL`): the class that filters results per user, linked to its application package.
- **Document Security Query Attributes** (`PSPTSF_SD_DCATR`): the query fields used as security attributes, with the Allow or Deny privilege.
- **Generic Record Security Attributes** (`PSPTSF_GN_DCATR`): the same for record-based definitions.
- **Source-Level Access Control** (`PSPTSF_SD_SRACL`): the roles and users granted or denied the whole definition.

### Records & Component Keyword Search

- **Indexed Records** (`PSPTSF_RECORDS`) and **Record Field Mappings** (`PSPTSF_SRCHATTR`): filled for record-based definitions. Query-based definitions, which include every definition delivered in the PeopleTools 8.62 Campus Solutions demo database, leave both empty.
- **Component Keyword Search Mappings** (`PSPTSF_SD_PNLGP`): the components whose keyword search uses this definition, with market and search criteria.

### Deployment & Index History

- **Deployed Search Instances** (`PTSF_DEPLOY_OBJ`): each search instance the definition is deployed to, with the deployed name and ID. No rows means the definition is not deployed.
- **Latest Index Build per Search Instance** (`PTSF_SCHED_STAT`, `PTSF_INDEX_STAT`): process instance, run control, crawl mode, feed generation and Application Engine status, and the indexed and error document counts when PeopleSoft recorded them. A successful build can leave the counts at zero, in which case the card shows a dash.

### Real-Time & Incremental Indexing

- **Real-Time Indexing Configuration** (`PTSF_INDEX`, `PTSF_RTI_STATUS`): whether Real-Time Indexing is enabled, the parent record, the batch threshold, and the batch switch status.
- **RTI Trigger Records** (`PTSF_INDEXTRREC`, `PTSF_INDEXTRFLD`): the records that carry a database trigger, the trigger name (`SFA_<RECNAME>_TR`), and the monitored fields. When the query reads a temp table, the trigger is on the physical record, and that is the name shown.
- **Incremental Timestamp Records** (`PTSF_INC_C_REC`): the record, field, and audit field used for incremental builds.

### Included in Projects

Queries `PSPROJECTITEM` where `OBJECTTYPE = 116` to list the Application Designer projects that contain the search definition.

## Where Search Definitions Appear Elsewhere

- **[Record detail pages](/docs/objects/records/)** have a Search Framework Usage panel listing the search definitions that index the record.
- **[Query detail pages](/docs/objects/queries/)** have a Used by Search Definitions panel.
- **The [Search Framework Monitor](/docs/monitor/search-framework/)** lists every deployed definition with its latest build, Real-Time Indexing status, queue depth, and errors.
- **The [Search Framework Integrity Audit](/docs/reports/objects/ptsf-integrity-audit/) report** finds definitions that reference a missing query, Application Engine program, or application class.
- **The [Search Framework Security Audit](/docs/reports/security/ptsf-security-audit/) report** finds deployed definitions with no security and definitions that index a sensitive field.
- **MCP:** `get_definition` with `type="search"` returns the same data as the Markdown export.
