Skip to content

Conversation

@bevzzz
Copy link
Collaborator

@bevzzz bevzzz commented May 6, 2025

Closes #376

NearText search

var songs = client.collections.use("Songs");

// One concept
songs.query.nearText("rain", opt -> opt.distance(.1f));

// Multiple concepts
songs.query.nearText(List.of("black", "yellow"),
  opt -> opt
    .moveTo(.2f, to -> to.concepts("money", "party"))
    .moveAway(.5f, away -> away.uuids("0000-000-000-000000")));

// Group by works as expected
songs.query.nearText("weather", new GroupBy("month", 12, 5));

New vectorizers

Vectorizer.text2vecContextionary(opt -> opt.vectorizeCollectionName(true));

Vectorizer.text2vecWeaviate(opt -> opt.dimensions(384));

Vectorizer.multi2vecClip(opt -> opt.imageFields("avatar").textFields("bio", "hobbies"));

Vectorizer.img2vecNeural(opt -> opt.imageFields("avatar"));

Blob data type

// Create BLOB property
client.collections.create("Creators",
  collection -> collection.properties(
    Property.text("name"),
    Property.integer("followers"),
    Property.blob("avatar")));

var creators = client.collections.use("Creators");

// Insert data: nothing surprising here yet (planning to add some DX-boosters in the future)
creators.data.insert(Map.of(
  "name", "johndoe",
  "followers", 100_243,
  "avatar", "<base64-encoded-image>"))

// Query lookalikes
creators.query.nearImage("<base64-encoded-image>", opt -> opt.limit(6));

Note

  • NearText does not support targets yet (neither does nearVector)
  • NearImage does not have groupBy

Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

@bevzzz bevzzz mentioned this pull request May 6, 2025
@bevzzz bevzzz marked this pull request as ready for review May 7, 2025 15:18
bevzzz added 2 commits May 8, 2025 13:46
Use that instead of multi2vec-clip in integration tests
for near image search. Un-ignore testNearImage
@bevzzz bevzzz merged commit bfcc268 into v6 May 8, 2025
2 checks passed
@bevzzz bevzzz deleted the v6-iteration1-feedback branch May 8, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants