Packages

A search deployment helper library. Aims to easy deployment and monitoring of distributed Manticore & Sphinx in a Linux environment

Current section

Files

Jump to
khafra_search lib sample test_schema.ex
Raw

lib/sample/test_schema.ex

defmodule Khafra.Sample.TestSchema do
use Ecto.Schema
import Ecto.Changeset
@behaviour Khafra.SearchBehaviour
schema "test" do
field :city, :string
field :temp_lo, :integer
field :temp_hi, :integer
field :score, :float
field :desc, :string
timestamps()
end
@doc false
def changeset(test, attrs) do
test
|> cast(attrs, [:city, :temp_lo, :temp_hi, :score, :desc])
end
@impl Khafra.SearchBehaviour
def index_fields, do: [:city, :desc]
end