View this page in the latest version of Appian. Implement Smart Search Share Share via LinkedIn Reddit Email Copy Link Print On This Page This page explains how to enable smart search on a record type and implement it in your applications using grids, queries, and chatbots. Before you begin, make sure you understand smart search and meet the requirements. Enable smart search Enabling smart search on a synced record type gives you access to both semantic and lexical search capabilities for the fields you select. Once you enable smart search, you can choose which specific search type (semantic or lexical) to use when implementing smart search in your queries or interfaces. Note: Before you begin, review the smart search requirements to confirm your record type, fields, and environment are supported. To enable fields for smart search: In your synced record type, go to Smart Search. Choose a supported field combination. Select an Indexing Failure Tolerance Level for the record type: Strict: (Default) No tolerance for failures. Limited: Some tolerance for failures. Relaxed: Full tolerance for failures. Click SAVE. Saving the record type starts a full sync. Once the sync completes, the indexing process for smart search begins automatically. You can monitor the indexing status from the record type or the Monitor view. Indexing failure tolerance level Configure an indexing failure tolerance level to keep smart search online even if some records fail to index. This prevents minor data issues, such as an oversized document or a single index error, from disabling smart search functionality for the entire record type. Select a tolerance level on the Smart Search page of the record type: Tolerance Level Description Recommended When Strict Requires 100% of data to index successfully. If any row fails, smart search goes offline. This is the default setting. Use for production environments where accuracy and data integrity are critical. Limited Allow up to 5% of total rows to fail indexing. If failures exceed this threshold, smart search goes offline. Use when keeping smart search online is a higher priority than indexing every single record. Relaxed Allows indexing to proceed regardless of errors. Smart search remains online regardless of failures. Use for development or testing environments where search completeness is not required. Indexing performance best practices Search time increases as the number of rows and searchable fields grows. Generally, Text fields index the fastest. Extra Long Text fields index more slowly than Text fields, and documents may take the longest to index. To ensure optimal performance: Only enable smart search for fields that are strictly necessary for your users. If you do not need to search the full content of an Extra Long Text field or document, consider extracting key metadata into a Text field and indexing that instead. Smart search indexing will almost always take more time to complete than the sync itself, regardless of the field type. This is expected behavior because indexing involves additional processing beyond what a standard sync requires. The difference is most pronounced during first-time indexing. Subsequent indexing is typically much faster because only rows updated since the last index are processed. For documents near the size limits, indexing time can increase further. We recommend validating indexing time in your environment if you plan to index a large number of large documents. Implement smart search After you enable fields for smart search, you can implement semantic search and lexical search throughout your applications. How you implement search depends on the function or component you're using. The following table shows which search types are supported in each location and how to implement them: Location Supported Search Types Smart Search Implementation Default search box in a read-only grid Semantic or lexical Grid component parameters (smartSearchType) Custom search box in a read-only grid Semantic and lexical a!smartSearch() in a!recordData() filters a!queryRecordType() expression Semantic and lexical a!smartSearch() in the filters parameter a!relatedRecordData() expression Semantic and lexical a!smartSearch() in the filters parameter Data fabric chatbot Semantic Automatic (no additional configuration) Use smart search in the default grid search box Supported search capability: Semantic search or lexical search When you use a record type as the source for a read-only grid, you can configure the grid's default search box to apply semantic search or lexical search in addition to keyword search. This approach uses the smartSearchType, similarityScoreThreshold, and searchFields parameters on the read-only grid component. For implementation steps, see Use smart search in the default grid search box on the Read-Only Grid page. Use smart search in a custom search box Supported search capability: Semantic search and lexical search If you want to customize the grid's search box and its styling, you must build a custom search box. This approach involves using a separate input component, typically a text component, to capture user search terms and apply them as filters to your record data. When you implement a custom search box: No grid search parameters: You cannot use the smartSearchType, similarityScoreThreshold, or searchFields parameters in the read-only grid. Instead, use a!smartSearch() to define which fields to search on. Search scope: Smart search is only applied on the fields you define in a!smartSearch() expressions. To search on multiple fields, combine filters in an a!queryLogicalExpression() function. No keyword search: A custom search box does not automatically include keyword search like the default search box. Only the smart search type you specify in a!smartSearch() is applied. To implement smart search in a custom grid search box: Create a local variable to store your search terms. For example, local!searchTerm. Add a text component to your interface to serve as the search box. Set the value and saveInto parameters to your local variable (local!searchTerm). In the read-only grid, use a!recordData() to configure the source using your record type with smart search enabled. In the read-only grid, set the showSearchBox parameter to false. In the filters parameter of a!recordData(), add a!queryLogicalExpression() to apply one or more a!smartSearch() functions. For the operator, use "OR" to return records that match in any of the searched fields, or "AND" to require a match in all fields. In the filters parameter of a!queryLogicalExpression(), add an a!smartSearch() function for each field you want to search on: For searchField, reference a field enabled for smart search. For searchType, enter "semantic search" or "lexical search". For searchTerms, reference your local variable (local!searchTerm). For similarityScoreThreshold, enter a similarity score to narrow the semantic search results. Do not configure this parameter for lexical searches. For applyWhen, use a!isNotNullOrEmpty() to only apply the search when a search term is entered. For example, a!isNotNullOrEmpty(local!searchTerm). Tip: You can apply both semantic search and lexical search on the same field. See the Configure a Custom Search Box in a Read-Only Grid: Smart Search recipe for a full expression implementing smart search in a custom search box. Use smart search in an a!queryRecordType() expression Supported search capability: Semantic search and lexical search Use a!smartSearch() in the filters parameter of a!queryRecordType() to apply smart search when retrieving data for an interface or process model. For details on configuring the function's parameters, see a!smartSearch() To use smart search in a!queryRecordType(): Use a!queryRecordType() to build a query to your record type. In the filters parameter of a!queryRecordType(), add a!queryLogicalExpression() to apply one or more a!smartSearch() functions. For the operator, use "OR" to return records that match in any of the searched fields, or "AND" to require a match in all fields. In the filters parameter of a!queryLogicalExpression(), add an a!smartSearch() function for each field you want to search on: For searchField, reference a field enabled for smart search. For searchType, enter "semantic search" or "lexical search". For searchTerms, enter the search term or local variable to search on. For similarityScoreThreshold, enter a similarity score to narrow the semantic search results. Do not configure this parameter for lexical searches. (Optional) For applyWhen, use a!isNotNullOrEmpty() to only apply the search when a search term is entered. For example, a!isNotNullOrEmpty(local!searchTerm). In the pagingInfo parameter of a!queryRecordType(), add a!sortInfo() to sort by similarity score in descending order so the most relevant results are first. See the following examples to learn how to: Implement semantic search in a query. Implement lexical search in a query. Implement both semantic and lexical search in a query. Search across Appian-stored documents. Search across externally-stored documents. Use smart search in a!relatedRecordData() Supported search capability: Semantic search and lexical search When querying one-to-many related record data, you can apply smart search in a!relatedRecordData() to filter the related records returned for each base record. Use a!smartSearch() in the filters parameter to find the most relevant related records based on meaning or exact phrasing. For implementation steps and field reference requirements, see Using smart search in a!relatedRecordData. Use semantic search in a data fabric chatbot Supported search capability: Semantic search To use semantic search in a data fabric chatbot, reference a record type with smart search enabled in the recordTypes parameter. This will automatically apply semantic search to the data fabric chat queries. Note: Data fabric chatbot only applies semantic search to Text and Extra Long Text fields. Data fabric chatbot does not apply semantic search on any documents. Feedback Was this page helpful? SHARE FEEDBACK Loading...