Skip to content

chore(search): refactor SqliteSearch out of searches.py

What does this merge request do and why?

Simple refactor, no functional changes.

Steps to reproduce

Reproducing:

  1. Enable self-hosted models in env.

    AIGW_CUSTOM_MODELS__ENABLED=True
  2. On GitLab master create the index

    cd path/to/gitlab
    python3 scripts/custom_models/create_index.py -o ~/docs.db 
    mv ~docs.db /path/to/ai_gateway/tmp/docs.db
  3. Make a query (either on http://localhost:5052/docs#/search/docs_v1_search_gitlab_docs_post or in the terminal)

curl -X 'POST' \
  'http://localhost:5052/v1/search/gitlab-docs' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "string",
  "metadata": {
    "source": "string",
    "version": "17.0.0-pre"
  },
  "payload": {
    "query": "create an issue",
    "page_size": 4
  }
}'

Closes #545 (closed)

Edited by Eduardo Bonet

Merge request reports