Skip to content

Conversation

@cnlucas
Copy link
Member

@cnlucas cnlucas commented Jan 23, 2026

Summary (required)

This PR upgrades us to opensearch 2.11. This is as far as we can go because we are limited by cloud.gov service options.

Required reviewers

2-3 reviewers

Impacted areas of the application

General components of the application that this PR will affect:

  • legal search and tasks

How to test

  • pull this branch
  • create and activate a new pyenv then run req files
pyenv virtualenv 3.11.9 open
pyenv activate open
pip install -r requirements.txt
pip install -r requirements-dev.txt
npm i && npm run build
  • open a seperate tab
  • install opensearch
    navigate to wherever you want it, I created a folder then ran:
    NOTE: this is the compatible version for MAC chips (which is what I have, but I'm not sure if others have INTEL)
curl -L -O https://artifacts.opensearch.org/releases/bundle/opensearch/1.3.20/opensearch-1.3.20-linux-x64.tar.gz
tar -zxf opensearch-1.3.20-linux-x64.tar.gz
cd opensearch-1.3.20
cd bin

When running opensearch locally you need to run this command:

./opensearch \
  -E plugins.security.disabled=true

OR
add TODO

NOTE: You may get an error if your java version isn't compatible or up to date. How you do this will depend on if you're using brew for java. I had to update mine in brew and add this to my .zshrc:
export JAVA_HOME=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home

go back to your openfec tab
pytest
test OS commands locally:

python cli.py create_index case_index
python cli.py create_index ao_index
python cli.py create_index arch_mur_index
python cli.py create_index rm_index
python cli.py display_index_alias

Try loading a few of each:

python cli.py initialize_legal_data case_index
python cli.py initialize_legal_data ao_index
python cli.py initialize_legal_data arch_mur_index
python cli.py initialize_legal_data rm_index

Load statutes and regs:

python cli.py load_statutes
python cli.py load_regulations

Test individual load:

python cli.py load_current_murs 8003
python cli.py load_adrs 008
python cli.py load_admin_fines 3314
python cli.py load_archived_murs 400

Start the server, run some queries:
http://127.0.0.1:5000/v1/legal/search/?q=many
http://127.0.0.1:5000/v1/legal/search/?ao_is_pending=false

Use management commands WIKI to test in a space.

Here's the branch to rebuild on stage: https://app.circleci.com/pipelines/github/fecgov/openFEC/3969/workflows/5c07b613-0bf8-41fa-8610-9ca2fa9246ea/jobs/6990

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Upgrade to opensearch 2.11.x

2 participants