Skip to main content
Image search lets users find images by supplying an example image. It uses the pre-trained embedding model siglip2-so400m-patch14-384, which encodes images into vectors. Image search works alongside Neural Hybrid Search, which handles text search. Image search suits catalogs and content where images are visually distinctive, such as fashion, home goods, marketplaces, and image libraries. It also supports visually similar recommendations, and identifying parts from a photo when the part number isn’t known.

Before you begin

1

Add a vector field type for 1152 dimensions

The model returns 1152-dimensional vectors, a size the default schema doesn’t include. Go to System > Solr Config, open managed-schema, and add this field type and dynamic field:
2

Vectorize images when indexing

In the index pipeline, add an LWAI Vectorize Field or LWAI Batch Vectorize stage. Configure the stage with the following settings:
  • Model: siglip2-so400m-patch14-384.
  • Source: the field that holds each document’s image URL, such as image_url_s.
  • Destination: a field that ends in _1152v, such as image_1152v.
  • Model Configuration: a parameter named imageData with the value URL. If the source field holds base64-encoded images instead of URLs, use the value base64.
Lucidworks AI fetches each image itself, so image URLs must be publicly reachable.
3

Vectorize query images

In the query pipeline, add an LWAI Vectorize Query stage. Configure the stage with the following settings:
  • Model: siglip2-so400m-patch14-384.
  • Query Input: <request.params.q>.
  • Output Context Variable: vector.
  • Model Configuration: a parameter named imageData with the value URL if queries send image URLs, or base64 if they send base64-encoded images.
Base64-encoded images are large, so send them as form-encoded parameters in the body of a POST request, not in the URL.
4

Search the image vectors

After the LWAI Vectorize Query stage and before the Solr Query stage, add an Additional Query Parameters stage. Add the following parameters, each with the policy replace:Replace image_1152v with the destination field from the index stage, and set topK to the number of nearest images to return.Set the stage’s Condition so it runs only when the query contains an image:

Limitations

  • Products that look alike, or that share the same stock image, can’t be told apart by their images.
For details about the model’s behavior, see Image model.

Learn more