Extending Search with AI Image and Video Analysis #15757
-
Hey all, I've got a large amount of assets in a Craft install (40k+) - photos and video from a marketing company. I'm looking at integrating an AI search API like Google Vision and Algolia to analyze and index photos and videos so I could allow someone to search for assets with natural language (e.g. "horses on a sunny day"). Would overriding the asset search even be possible in order to enable this kind of functionality? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can latch onto the |
Beta Was this translation helpful? Give feedback.
You can latch onto the
ElementQuery::EVENT_BEFORE_PREPARE
event, and make whatever modifications you want to it, like scraping thesearch
param value and passing it to an API, and then removingsearch
and adding$query->andWhere(['elements.id' => $filteredElementIds])
.