Smart Search Query Size Limitations
Hi everyone,
We're experiencing query-size issues when using Smart Search across multiple fields, including nested related record fields, on a dataset of approximately 66,000 records.
The queries execute successfully without Smart Search, but certain Smart Search queries exceed Appian's maximum response size.
Error:
APNX-3-1000-0B1: Query response size (114376770 bytes) exceeded max allowed (15728640 bytes)
We've tested both a!recordData() inside of a grid using the smart search parameters and a!queryRecordType() outside of a grid using a!smartSearch, and the issue occurs with both approaches. Reducing the number of fields retrieved helps avoid the error in some cases, but this limits the data we can display.
We understand that Smart Search increases the query response size, particularly when searching nested related record fields.
Our main question is why Smart Search causes such a significant increase in the amount of data returned compared to the same query without Smart Search. Is Smart Search retrieving additional data from related records beyond the fields explicitly requested, or is there something else contributing to the increased response size?
Additionally, are there recommended ways to reduce this overhead without limiting the searchable fields or the data returned in the results?
Example query:
a!queryRecordType(
recordType: 'recordType!Record',
filters: a!queryLogicalExpression(
operator: "AND",
logicalExpressions: {
a!queryLogicalExpression(
operator: "OR",
filters: {
a!smartSearch(
searchField: 'recordType!Record.relationships.relationship1.fields.field1',
searchType: "semantic search",
searchTerms: "a"
),
a!smartSearch(
searchField: 'recordType!Record.relationships.relationship2.fields.field1',
searchType: "semantic search",
searchTerms: "a"
),
a!smartSearch(
searchField: 'recordType!Record.relationships.relationship3.relationships.relationship4.fields.field1',
searchType: "semantic search",
searchTerms: "a"
)
}
)
}
),
fields: {
'recordType!Record.fields.field1',
'recordType!Record.fields.field2',
'recordType!Record.relationships.relationship1.fields.field1',
'recordType!Record.relationships.relationship2.fields.field1',
'recordType!Record.relationships.relationship3.relationships.relationship4.fields.field1',
'recordType!Record.relationships.relationship5.relationships.relationship6.fields.field1',
'recordType!Record.searchResults.allSearchFields'
},
pagingInfo: local!pagingInfo,
fetchTotalCount: true
)
