-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
8,737 additions
and
3,349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
|
||
*.ex diff=elixir | ||
*.exs diff=elixir | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,44 @@ | ||
defmodule ExTypesense.TestSchema.Catalog do | ||
use Ecto.Schema | ||
@behaviour ExTypesense | ||
|
||
@moduledoc false | ||
|
||
defimpl Jason.Encoder, for: __MODULE__ do | ||
def encode(value, opts) do | ||
value | ||
|> Map.take([:catalogs_id, :name, :description]) | ||
|> Enum.map(fn {key, val} -> | ||
if key === :catalogs_id, do: {key, Map.get(value, :id)}, else: {key, val} | ||
end) | ||
|> Enum.into(%{}) | ||
|> Jason.Encode.map(opts) | ||
end | ||
end | ||
|
||
schema "catalogs" do | ||
field(:name, :string) | ||
field(:description, :string) | ||
field(:catalogs_id, :integer, virtual: true) | ||
end | ||
|
||
@impl ExTypesense | ||
def get_field_types do | ||
name = __MODULE__.__schema__(:source) | ||
primary_field = name <> "_id" | ||
|
||
%{ | ||
name: name, | ||
default_sorting_field: primary_field, | ||
fields: [ | ||
%{name: primary_field, type: "int32"}, | ||
%{name: "name", type: "string"}, | ||
%{name: "description", type: "string"} | ||
] | ||
} | ||
end | ||
end | ||
|
||
import Ecto.Query, warn: false | ||
alias ExTypesense.Cluster | ||
alias ExTypesense.Collection | ||
alias ExTypesense.Connection | ||
alias ExTypesense.Document | ||
alias ExTypesense.HttpClient | ||
alias ExTypesense.Search | ||
|
||
alias ExTypesense.TestSchema.Catalog | ||
alias ExTypesense.TestSchema.MultiSearch | ||
alias ExTypesense.TestSchema.Person | ||
alias ExTypesense.TestSchema.Product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as the maintainers of this project, respects all people who contributes via raising issues, submission of requests, enhancement of documentation, patches and rest of activities regardless of the level of experience. We aim an inclusive, diverse, welcoming, open, and healthy interaction towards the community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our | ||
community include: | ||
|
||
* Demonstrating empathy and kindness toward other people | ||
* Being respectful of differing opinions, viewpoints, and experiences | ||
* Giving and gracefully accepting constructive feedback | ||
* Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
* Focusing on what is best not just for us as individuals, but for the overall | ||
community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
* The use of sexualized language or imagery, and sexual attention or advances of | ||
any kind | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or email address, | ||
without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
Maintainers have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct, and will communicate reasons for moderation | ||
decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all this project, and also applies when | ||
an individual is officially representing the community in public spaces. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by opening an issue or contacting one or more of the project maintainers. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
reporter of any incident. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 2.1, available at | ||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Contributing | ||
|
||
## Pull Request | ||
|
||
1. Fork repo (https://github.com/jaeyson/ex_typesense/fork) | ||
2. Clone to your local machine, `git clone [email protected]:your_username/ex_typesense.git && cd ex_typesense` | ||
3. Create branch, _e.g._ `git checkout -b manage-backups-and-restores` | ||
4. Commit changes, _e.g._ `git commit -am 'manage backups and restores (snapshots)'` | ||
5. Push the new branch, _e.g._ `git push -u origin manage-backups-and-restores` | ||
6. [Create new Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) | ||
|
||
## Local development | ||
|
||
Please refer: https://hexdocs.pm/ex_typesense/running_local_typesense.html |
Oops, something went wrong.