{"id":22747211,"url":"https://github.com/one-com/simple-search-language","last_synced_at":"2025-03-30T05:40:41.038Z","repository":{"id":57360836,"uuid":"222406049","full_name":"One-com/simple-search-language","owner":"One-com","description":null,"archived":false,"fork":false,"pushed_at":"2019-11-18T09:22:06.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-18T13:53:22.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/One-com.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-11-18T09:04:50.000Z","updated_at":"2019-11-18T09:22:09.000Z","dependencies_parsed_at":"2022-09-06T22:20:57.132Z","dependency_job_id":null,"html_url":"https://github.com/One-com/simple-search-language","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fsimple-search-language","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fsimple-search-language/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fsimple-search-language/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fsimple-search-language/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/One-com","download_url":"https://codeload.github.com/One-com/simple-search-language/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246281218,"owners_count":20752207,"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":[],"created_at":"2024-12-11T03:13:43.006Z","updated_at":"2025-03-30T05:40:41.010Z","avatar_url":"https://github.com/One-com.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Search Language\n\nThe module is a parser for complex search strings.\n\nIt allows deriving a structured representation from a serach string\nthat can contain complex operators. It is intended for sitations\nwhere a complex query against a text field is inut as a string.\n\n## Usage\n\nWhen imported the module exports a function that allows the caller\nto supply a list of labels that are supported when parsing. Doing\nso will return a function that will parse a given query with the\nsupplied search query:\n\n```js\nconst simpleSearchLanguage = require('simple-search-language');\n\nconst processSearch = simpleSearchLanguage({\n  labels: ['somelabel', 'otherlabel']\n});\n```\n\nThe function that is returned can then be called to with a given\nsearch term and the output requested in a given format:\n\n```js\nconst parsedResult = processSearch('foo bar somelabel:baz', { format: 'json' });\n```\n\n## Search Language representations\n\nA query in this language has roughly this grammer:\n\n    token = list | \"-\" token | text | Label text\n    list  = \"(\" expr \")\"\n    expr  = token | token OR expr | token (AND) expr\n    Label = (from: | to: | cc: | bcc: | subject:) text\n    text  = \"a-z\"+ | '\"' [^\"]+ '\"'\n\n- The (AND) is implicit (but should maybe be explicit?)\n\n## License\n\nsimple-search-language is licensed under a standard\n3-clause BSD license -- see the `LICENSE`-file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fsimple-search-language","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fone-com%2Fsimple-search-language","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fsimple-search-language/lists"}