Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

feat: update/create index mappings on objects #9

Open
auguwu opened this issue Mar 21, 2022 · 0 comments
Open

feat: update/create index mappings on objects #9

auguwu opened this issue Mar 21, 2022 · 0 comments

Comments

@auguwu
Copy link
Member

auguwu commented Mar 21, 2022

This will be tagged as a 0.4 release but I wanted to do some sort of query DSL:

I proposed this idea internally (in my brain, I have no friends except my boyfriend 😢) that I wanted to create a query DSL to make searching objects more easily than what the current Elasticsearch query is.

It will be called the Tsubasa Query Language (short-hand: TQL) that is similarly to GraphQL but it's stored on the server of all the data types available (under the filesystem called datatypes.tql or in a key-store database (Redis, etcd)).

To define a data type, you can do:

define(DataType, "<DATA_TYPE_NAME>", "<elastic data type>")

This will create a new entry in etcd, Redis, or in the filesystem as datatypes.json as so:

[
   { "data_type": "<DATA_TYPE_NAME>", "redirect_to": "<elastic data type>" }
]

Tsubasa will cache the datatypes.json object (or under Redis as the hash: tsubasa:datatypes; etcd: tsubasa/datatypes) in the container and now you can create a query:

search("index", FUZZY) { # Search on index "index" using the fuzzy query match type
    pretty() # Append ?pretty=true
    trackTotalHits() # Appends ?track_total_hits=true
}

(this issue is unfinished)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant