{"id":37066941,"url":"https://github.com/foliant-docs/foliantcontrib.elasticsearch","last_synced_at":"2026-01-14T07:51:27.362Z","repository":{"id":57431724,"uuid":"235111948","full_name":"foliant-docs/foliantcontrib.elasticsearch","owner":"foliant-docs","description":"Elasticsearch integration extension for Foliant","archived":false,"fork":false,"pushed_at":"2020-04-13T22:34:53.000Z","size":99,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-09-24T22:35:50.602Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/foliant-docs.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2020-01-20T13:49:21.000Z","updated_at":"2023-02-04T19:33:54.000Z","dependencies_parsed_at":"2022-09-02T11:51:55.399Z","dependency_job_id":null,"html_url":"https://github.com/foliant-docs/foliantcontrib.elasticsearch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/foliant-docs/foliantcontrib.elasticsearch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foliant-docs","download_url":"https://codeload.github.com/foliant-docs/foliantcontrib.elasticsearch/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.elasticsearch/sbom","scorecard":{"id":406071,"data":{"date":"2025-08-11","repo":{"name":"github.com/foliant-docs/foliantcontrib.elasticsearch","commit":"a1caabfe046cd3005366bd02a41bcd86d463690b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'develop'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T21:17:37.344Z","repository_id":57431724,"created_at":"2025-08-18T21:17:37.344Z","updated_at":"2025-08-18T21:17:37.344Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-14T07:51:26.806Z","updated_at":"2026-01-14T07:51:27.349Z","avatar_url":"https://github.com/foliant-docs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elasticsearch Extension\n\nThis extension allows to integrate Foliant-managed documentation projects with [Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/elasticsearch-intro.html) search engine.\n\nThe main part of this extension is a preprocessor that prepares data for a search index.\n\nAlso this extension provides a simple working example of a client-side Web application that may be used to perform searching. By editing HTML, CSS and JS code you may customize it according to your needs.\n\n## Installation\n\nTo install the preprocessor, run the command:\n\n```bash\n$ pip install foliantcontrib.elasticsearch\n```\n\nTo use an example of a client-side Web application for searching, download [these HTML, CSS, and JS files](https://github.com/foliant-docs/foliantcontrib.elasticsearch/tree/master/webapp_example/) and open the file `index.html` in your Web browser.\n\n## Config\n\nTo enable the preprocessor, add `elasticsearch` to `preprocessors` section in the project config:\n\n```yaml\npreprocessors:\n    - elasticsearch\n```\n\nThe preprocessor has a number of options with the following default values:\n\n```yaml\npreprocessors:\n    - elasticsearch:\n        es_url: 'http://127.0.0.1:9200/'\n        index_name: ''\n        index_copy_name: ''\n        index_properties: {}\n        actions:\n            - delete\n            - create\n        use_chapters: true\n        format: plaintext\n        escape_html: true\n        url_transform:\n            - '\\/?index\\.md$': '/'\n            - '\\.md$': '/'\n            - '^([^\\/]+)': '/\\g\u003c1\u003e'\n        require_env: false\n        targets: []\n```\n\n`es_url`\n:   Elasticsearch API URL.\n\n`index_name`\n:   Name of the index. Your index must have an explicitly specified name, otherwise (by default) API URL will be invalid.\n\n`index_copy_name`\n:   Name of the index copy when the `copy` action is used; see below. If the `index_copy_name` is not set explicitly, and if the `index_name` is specified, the `index_copy_name` value will be formed as the `index_name` value with the `_copy` string appended to the end.\n\n`index_properties`\n:   Settings and other properties that should be used when creating an index. If not specified (by default), the default Elasticsearch settings will be used. More details are described below.\n\n`actions`\n:   Sequence of actions that the preprocessor should to perform. Available item values are: `delete`, `create`, `copy`. By default, the actions `delete` and `create` are performed since in most cases it’s needed to remove and then fully rebuild the index. The `copy` action is used to duplicate an index, i.e to create a copy of the index `index_name` with the name `index_copy_name`. This action may be useful when a common search index is created for multiple Foliant projects, and the index may remain incomplete during for a long time during their building. The `copy` action is not atomic. To perform it, the preprocessor:\n\n    * marks the source index `index_name` as read-only;\n    * deletes the target index `index_copy_name` if it exists;\n    * clones the source index `index_name` and thereby creates the target index `index_copy_name`;\n    * unmarks the source index `index_name` as read-only;\n    * also unmarks the target index `index_copy_name` as read-only, since the target index inherits the settings of the source one.\n\n`use_chapters`\n:   If set to `true` (by default), the preprocessor applies only to the files that are mentioned in the `chapters` section of the project config. Otherwise, the preprocessor applies to all of the files of the project.\n\n`format`\n:   Format that the source Markdown content should be converted to before adding to the index; available values are: `plaintext` (by default), `html`, `markdown` (for no conversion).\n\n`escape_html`\n:   If set to `true` (by default), HTML syntax constructions in the content converted to `plaintext` will be escaped by replacing `\u0026` with `\u0026amp;`, `\u003c` with `\u0026lt;`, `\u003e` with `\u0026gt;`, and `\"` with `\u0026quot;`.\n\n`url_transform`\n:   Sequence of rules to transform local paths of source Markdown files into URLs of target pages. Each rule should be a dictionary. Its data is passed to the [`re.sub()` method](https://docs.python.org/3/library/re.html#re.sub): key as the `pattern` argument, and value as the `repl` argument. The local path (possibly previously transformed) to the source Markdown file relative to the temporary working directory is passed as the `string` argument. The default value of the `url_transform` option is designed to be used to build static websites with MkDocs backend.\n\n`require_env`\n:   If set to `true`, the `FOLIANT_ELASTICSEARCH` environment variable must be set to allow the preprocessor to perform any operations with Elasticsearch index. This flag may be useful in CI/CD jobs.\n\n`targets`\n:   Allowed targets for the preprocessor. If not specified (by default), the preprocessor applies to all targets.\n\n## Usage\n\nThe preprocessor reads each source Markdown file and generates three fields for indexing:\n\n* `url`—target page URL;\n* `title`—document title, it’s taken from the first heading of source Markdown content;\n* `content`—source Markdown content, optionally converted into plain text or HTML.\n\nWhen all the files are processed, the preprocessor calls Elasticsearch API to create the index.\n\nOptionally the preprocessor may call Elasticsearch API to delete previously created index.\n\nBy using the `index_properties` option, you may override the default Elasticsearch settings when creating an index. Below is an example of JSON-formatted value of the `index_properties` option to create an index with Russian morphology analysis:\n\n```json\n{\n    \"settings\": {\n        \"analysis\": {\n            \"filter\": {\n                \"ru_stop\": {\n                    \"type\": \"stop\",\n                    \"stopwords\": \"_russian_\"\n                },\n                \"ru_stemmer\": {\n                    \"type\": \"stemmer\",\n                    \"language\": \"russian\"\n                }\n            },\n            \"analyzer\": {\n                \"default\": {\n                    \"tokenizer\": \"standard\",\n                    \"filter\": [\n                        \"lowercase\",\n                        \"ru_stop\",\n                        \"ru_stemmer\"\n                    ]\n                }\n            }\n        }\n    }\n}\n```\n\nYou may perform custom search requests to Elasticsearch API.\n\nThe [simple client-side Web application example](https://github.com/foliant-docs/foliantcontrib.elasticsearch/tree/master/webapp_example/) that is provided as a part of this extension, performs requests like this:\n\n```json\n{\n    \"query\": {\n        \"multi_match\": {\n            \"query\": \"foliant\",\n            \"type\": \"phrase_prefix\",\n            \"fields\": [ \"title^3\", \"content\" ]\n        }\n    },\n    \"highlight\": {\n        \"fields\": {\n            \"content\": {}\n        }\n    },\n    \"size\": 50\n}\n```\n\nSearch results may look like that:\n\n![Search Results](https://raw.githubusercontent.com/foliant-docs/foliantcontrib.elasticsearch/develop/foliant_elasticsearch.png)\n\nIf you use self-hosted instance of Elasticsearch, you may need to configure it to append [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) headers to HTTP API responses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoliant-docs%2Ffoliantcontrib.elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoliant-docs%2Ffoliantcontrib.elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoliant-docs%2Ffoliantcontrib.elasticsearch/lists"}