Skip to content

How to Build Search Index

W. Bomar edited this page Mar 8, 2021 · 7 revisions

Site search requires an index of content available to search.

Steps

  1. Completely shut down all of your containers and restart them.

CMS

  1. Login to docker shell:

    docker exec -it core_portal_cms /bin/bash
    
  2. Index all searchable content:

    manage.py rebuild_index
    

Portal

  1. Login to docker shell:

    docker exec -it core_portal_django /bin/bash
    
  2. Enter python shell:

    python manage.py shell
    
  3. Index all searchable content:

    from portal.libs.elasticsearch.indexes import setup_files_index, setup_projects_index, setup_allocations_index
    setup_files_index()
    setup_projects_index()
    setup_allocations_index()
    
  4. Create a project(?):

    from portal.apps.projects.models.base import ProjectId
    ProjectId.objects.create(value=1).save()
    

Reference

Clone this wiki locally