AI rule node: improve text search to be based on provider and model as well
This commit is contained in:
parent
109c874861
commit
5e5a7c9e51
@ -90,7 +90,7 @@ public class ControllerConstants {
|
||||
protected static final String TENANT_PROFILE_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'substring' filter based on the tenant profile name.";
|
||||
protected static final String RULE_CHAIN_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'substring' filter based on the rule chain name.";
|
||||
protected static final String DEVICE_PROFILE_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'substring' filter based on the device profile name.";
|
||||
protected static final String AI_SETTINGS_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'substring' filter based on the AI settings name";
|
||||
protected static final String AI_SETTINGS_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'substring' filter based on the AI settings name, provider and model.";
|
||||
|
||||
protected static final String ASSET_PROFILE_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'substring' filter based on the asset profile name.";
|
||||
protected static final String CUSTOMER_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'substring' filter based on the customer title.";
|
||||
|
||||
@ -33,7 +33,10 @@ public interface AiSettingsRepository extends JpaRepository<AiSettingsEntity, UU
|
||||
@Query("SELECT ai " +
|
||||
"FROM AiSettingsEntity ai " +
|
||||
"WHERE ai.tenantId = :tenantId " +
|
||||
"AND (:textSearch IS NULL OR ilike(ai.name, CONCAT('%', :textSearch, '%')) = true)")
|
||||
"AND (:textSearch IS NULL " +
|
||||
"OR ilike(ai.name, CONCAT('%', :textSearch, '%')) = true " +
|
||||
"OR ilike(ai.provider, CONCAT('%', :textSearch, '%')) = true " +
|
||||
"OR ilike(ai.model, CONCAT('%', :textSearch, '%')) = true)")
|
||||
Page<AiSettingsEntity> findByTenantId(@Param("tenantId") UUID tenantId, @Param("textSearch") String textSearch, Pageable pageable);
|
||||
|
||||
Optional<AiSettingsEntity> findByTenantIdAndId(UUID tenantId, UUID id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user