{"id":44,"date":"2021-02-16T12:40:20","date_gmt":"2021-02-16T11:40:20","guid":{"rendered":"https:\/\/blog.kihr.online\/?p=44"},"modified":"2022-06-22T23:20:21","modified_gmt":"2022-06-22T21:20:21","slug":"automatischer-reindex-in-confluence","status":"publish","type":"post","link":"https:\/\/blog.kihr.online\/?p=44","title":{"rendered":"Automatischer reindex in Confluence"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Lesedauer<\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">Minute<\/span><\/span>\n<p class=\"wp-block-paragraph\">Confluence hat, anders als Jira, keine integrierte Funktion um einen automatischen Reindex zu schedulen. Nach Aussage von Atlassian ist das nicht notwendig und sollte nicht getan werden. Der Indexupdate erfolgt im Confluence bei jeder Dokumenten\u00e4nderung und der Index wird auch beim Neutstart von Confluence \u00fcberpr\u00fcft und gegebenfalls repariert. Ausserdem klann man einen Reindex als Admin jederzeit manuell \u00fcber die GUI starten.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">Trotzdem kann es manchmal notwendig sein, einen automatischen, regelm\u00e4ssigen Reindex durchzuf\u00fchren.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Es gibt eine nichtdokuentierte Funktion in der Rest API, die das erm\u00f6glicht. Der Aufruf kann so erfolgen:<br \/><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -o \/dev\/null --silent --head --write-out '%{http_code}\\n' -s -u &lt;user&gt;:&lt;password&gt; -X POST -H \"X-Atlassian-Token: nocheck\" &lt;confluence_url&gt;\/rest\/prototype\/1\/index\/reindex<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Bei erfolgreicher Ausf\u00fchrung erh\u00e4lt man den HTTP Statuscode 200 als Antwort. Den Fortschritt der Reindexierung kann man \u00fcber die GUI oder mittels des folgenden Aufrufes erhalten:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --silent -u &lt;user&gt;:&lt;password&gt; -X GET -H \"X-Atlassian-Token: nocheck\" &lt;confluence_url&gt;\/rest\/prototype\/1\/index\/reindex|python -mjson.tool|grep percentageComplete\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Als Ergebnis erh\u00e4lt man dann eine Ausgabe wie:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"percentageComplete\": 100<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Das ganze kann man in scripte einbauen oder etwa \u00fcber crontab oder systemd timer aufrufen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Es sein noch mal darauf hingwiesen, dass es sich um eine nicht dokumentierte API Funktion handelt, die auch jederzeit durch Atlassian entfernt werden kann und dieses Vorgehen auch durch Atlassian nicht supportet wird.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Lesedauer<\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">Minute<\/span><\/span>Confluence hat, anders als Jira, keine integrierte Funktion um einen automatischen Reindex zu schedulen. Nach Aussage von Atlassian ist das nicht notwendig und sollte nicht getan werden. Der Indexupdate erfolgt im Confluence bei jeder Dokumenten\u00e4nderung und der Index wird auch beim Neutstart von Confluence \u00fcberpr\u00fcft und gegebenfalls repariert. Ausserdem klann man einen Reindex als Admin [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":45,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[27,26],"tags":[25,23,24],"class_list":["post-44","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-automatisierung","category-confluence","tag-automatisch","tag-confluence","tag-reindex","entry","has-media"],"_links":{"self":[{"href":"https:\/\/blog.kihr.online\/index.php?rest_route=\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kihr.online\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kihr.online\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kihr.online\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kihr.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44"}],"version-history":[{"count":2,"href":"https:\/\/blog.kihr.online\/index.php?rest_route=\/wp\/v2\/posts\/44\/revisions"}],"predecessor-version":[{"id":52,"href":"https:\/\/blog.kihr.online\/index.php?rest_route=\/wp\/v2\/posts\/44\/revisions\/52"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.kihr.online\/index.php?rest_route=\/wp\/v2\/media\/45"}],"wp:attachment":[{"href":"https:\/\/blog.kihr.online\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kihr.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kihr.online\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}