def update_search(version_pk, commit): version = Version.objects.get(pk=version_pk) if 'sphinx' in version.project.documentation_type: page_list = process_all_json_files(version, build_dir=False) elif 'mkdocs' in version.project.documentation_type: page_list = process_mkdocs_json(version, build_dir=False) else: log.error('Unknown documentation type: %s' % version.project.documentation_type) return log_msg = ' '.join([page['path'] for page in page_list]) log.info("(Search Index) Sending Data: %s [%s]" % (version.project.slug, log_msg)) index_search_request( version=version, page_list=page_list, commit=commit, project_scale=0, page_scale=0, # Don't index sections to speed up indexing. # They aren't currently exposed anywhere. section=False, )
def update_search(version_pk, commit): version = Version.objects.get(pk=version_pk) if 'sphinx' in version.project.documentation_type: page_list = process_all_json_files(version, build_dir=False) if 'mkdocs' in version.project.documentation_type: page_list = process_mkdocs_json(version, build_dir=False) log_msg = ' '.join([page['path'] for page in page_list]) log.info("(Search Index) Sending Data: %s [%s]" % (version.project.slug, log_msg)) index_search_request(version=version, page_list=page_list, commit=commit)
def update_search(version, build): if 'sphinx' in version.project.documentation_type: page_list = process_all_json_files(version) if 'mkdocs' in version.project.documentation_type: page_list = process_mkdocs_json(version) data = { 'page_list': page_list, 'version_pk': version.pk, 'project_pk': version.project.pk, 'commit': build.get('commit'), } log_msg = ' '.join([page['path'] for page in page_list]) log.info("(Search Index) Sending Data: %s [%s]" % (version.project.slug, log_msg)) apiv2.index_search.post({'data': data})