WeaviateEx.Query.Move (WeaviateEx v0.7.4)

View Source

Move configuration for near_text queries.

Move operations allow you to shift the search vector towards or away from specified concepts or objects. This is useful for semantic search refinement.

Examples

# Move towards concepts
move_to = Move.to(0.5, concepts: ["summer", "beach"])

# Move away from objects
move_away = Move.to(0.25, objects: ["uuid-to-avoid"])

# Use in near_text query
Query.get("Article")
|> Query.near_text("fashion",
  move_to: move_to,
  move_away: move_away
)

Summary

Functions

Create a move configuration.

Convert move configuration to GraphQL format.

Types

t()

@type t() :: %WeaviateEx.Query.Move{
  concepts: [String.t()] | nil,
  force: float(),
  objects: [String.t()] | nil
}

Functions

to(force, opts \\ [])

@spec to(
  float(),
  keyword()
) :: t()

Create a move configuration.

Parameters

  • force - The force of the movement (0.0 to 1.0)
  • opts - Options:
    • :concepts - List of concept strings to move towards/away from
    • :objects - List of object UUIDs to move towards/away from

Examples

Move.to(0.5, concepts: ["summer", "beach"])
Move.to(0.25, objects: ["uuid-1", "uuid-2"])
Move.to(0.3, concepts: ["summer"], objects: ["uuid-1"])

to_graphql(move)

@spec to_graphql(t()) :: String.t()

Convert move configuration to GraphQL format.

Examples

move = Move.to(0.5, concepts: ["summer"])
Move.to_graphql(move)
# => "{force: 0.5, concepts: [\"summer\"]}"