{"id":19737925,"url":"https://github.com/allo-media/elm-es-simple-query-string","last_synced_at":"2026-01-10T16:16:05.519Z","repository":{"id":57674769,"uuid":"193590065","full_name":"allo-media/elm-es-simple-query-string","owner":"allo-media","description":"Parse and serialize ElasticSearch query strings.","archived":false,"fork":false,"pushed_at":"2019-12-09T13:48:12.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2023-08-08T20:37:49.226Z","etag":null,"topics":["elasticsearch","elm","parser","query"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/allo-media/elm-es-simple-query-string/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allo-media.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-24T22:34:27.000Z","updated_at":"2022-09-13T13:36:09.000Z","dependencies_parsed_at":"2022-09-02T17:08:57.319Z","dependency_job_id":null,"html_url":"https://github.com/allo-media/elm-es-simple-query-string","commit_stats":null,"previous_names":[],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allo-media%2Felm-es-simple-query-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allo-media%2Felm-es-simple-query-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allo-media%2Felm-es-simple-query-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allo-media%2Felm-es-simple-query-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allo-media","download_url":"https://codeload.github.com/allo-media/elm-es-simple-query-string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224197880,"owners_count":17271999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","elm","parser","query"],"created_at":"2024-11-12T01:12:47.330Z","updated_at":"2025-10-20T15:22:22.378Z","avatar_url":"https://github.com/allo-media.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elm simple elastic query\n\nParse and serialize [ElasticSearch](https://www.elastic.co/en) search query strings.\n\nThis package allows to parse an\n[elastic simple query string](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#_simple_query_string_syntax)\ninto an [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree), and serialize\nstring search queries out of it.\n\n**Notes:**\n\n  - Serialization will enforce classic boolean operator precedence by using\n    parenthesis groups everywhere applicable.\n\n[Demo](https://allo-media.github.io/elm-es-simple-query-string/)\n\n## Alphabet\n\n    ( ) Group\n    [WORD] Char+\n    | OR\n    \\+ AND\n    -- Exclude\n    \"\" Exact\n    ~n Fuzzy\n    \\* Prefix\n\nSpecific case : Spaces (signifying in some contexts and not in others)\n\n## AST\n\n```elm\ntype Expr\n    = And (List Expr)\n    | Exact String\n    | Exclude Expr\n    | Fuzzy Int String\n    | Or (List Expr)\n    | Prefix String\n    | Word String\n```\n\n## Production rules\n\nUnless explicitly indicated, spaces are ignored.\n\n    Query =\u003e ORExpr EOF\n    ORExpr =\u003e ANDExpr | ANDExpr \"|\" ORExpr\n    ANDExpr =\u003e EXCExpr | EXCExpr (\"+\"|\\s+) ANDExpr\n    EXCExpr =\u003e \"-\" GRPExpr | GRPExpr\n    GRPExpr =\u003e WORD~\"\\*\" | WORD~\"\\~2\" | WORD | \\\" EXACTExpr \\\" | \"(\" ORExpr \")\"\n    EXACTExpr =\u003e [^\"]+\n\n## Example\n\nSource query string:\n\n    big* (potatoes | \"french fries\") -salad\n\nParsing:\n\n    $ elm repl\n    ---- Elm 0.19.0 ----------------------------------------------------------------\n    Read \u003chttps://elm-lang.org/0.19.0/repl\u003e to learn more: exit, help, imports, etc.\n    --------------------------------------------------------------------------------\n    \u003e import Elastic exposing (Expr(..))   \n    \u003e Elastic.parse \"big* (potatoes | \\\"french fries\\\") -salad\"\n    Ok (And [Prefix \"big\",Or [Word \"potatoes\",Exact (\"french fries\")],Exclude (Word \"salad\")])\n      : Result (List Parser.DeadEnd) Elastic.Expr\n\nSerialization:\n\n    \u003e Elastic.serialize (And [Prefix \"big\",Or [Word \"potatoes\",Exact (\"french fries\")],Exclude (Word \"salad\")])\n    \"big* (potatoes | \\\"french fries\\\") -salad\" : String\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallo-media%2Felm-es-simple-query-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallo-media%2Felm-es-simple-query-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallo-media%2Felm-es-simple-query-string/lists"}