gim v1.0.0 Gim.Repo.Index View Source
Link to this section Summary
Functions
Adds an id to the given index
Intersects a list of indexes
Intersects the given indexes
Intersects a list of indexes
Joins the given indexes
Turns a given list into an index
Removes an id from the given index
Link to this section Types
Link to this section Functions
Adds an id to the given index
iex> add([], 42)
[42]
iex> add([404, 23, 13], 42)
[404, 42, 23, 13]
Since ids have to be unique, duplicates are prevented
iex> add([404, 42, 23, 13], 42)
[404, 42, 23, 13]
Intersects a list of indexes
iex> intersect([[99, 66, 77, 50, 30, 10, 0], [99, 70, 60, 50, 11, 10, 1, 0], [99, 50, 10]])
[99, 50, 10]
Intersects the given indexes
iex> intersect([99, 66, 77, 50, 30, 10, 0], [99, 70, 60, 50, 11, 10, 1, 0])
[99, 50, 10]
iex> intersect([], [99, 70, 60, 50, 11, 10, 1, 0])
[]
Intersects a list of indexes
iex> intersect([[99, 55, 42, 11], [98, 54, 42, 10], [90, 50, 42]])
[99, 98, 90, 55 , 54, 50, 42, 11, 10]
Joins the given indexes
iex> join([99, 50, 13], [90, 50, 10])
[99, 90, 50, 13, 10]
iex> intersect([], [99, 70, 60, 50, 11, 10, 1, 0])
[99, 70, 60, 50, 11, 10, 1, 0]
Turns a given list into an index
iex> new([10, 13, 6, 60, 2])
[60, 13, 10, 6, 2]
iex> new([2, 2, 2, 3])
[3, 2]
Removes an id from the given index
iex> remove([], 42)
[]
iex> remove([404, 42, 23, 13], 42)
[404, 23, 13]