To retrieve line-level values from a transaction record in a search and differentiate between item lines and shipping lines in the results, we can use the itemType value.
For example:
search.createColumn({
name: "formulatext",
formula: "CASE WHEN {itemType} = 'ShipItem' THEN 'Shipping Line' ELSE 'Item Line' END ",
label: "Line Type"
})