Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Сервіс пошуку реалізований у вигляді API та надає функціональність для обробки пошукових запитів.

Він підтримує параметри фільтрації, сортування та пагінації для ефективного отримання результатів.

Postman колекція ТУТ

Запити не вимагать авторизації

Доступні фільтри:

bySellingMethod

Дозволяє шукати обʼєкти процедур по "Напрямку роботи".

Доступні Напрямки роботи ТУТ (шукай колонку Назва процедури в ЦБД (sellingMethod))

Приклад запиту:

Code Block
curl --location 'https://procedure

Search Procedure API Service

Service to search by procedures/registry public data

Description

Service sync procedures/registry/auctions data and provide search with elasticsearch.
Search provided on top of the public data only, as it synchronized from the public data source.
For the full-text search, there is `full_text_search` field. It`s a service field, not shown by public api.

Swagger documentation

...

.prozorro.sale/api/

...

Software requirements

  • python3.9
  • Elasticsearch
  • aiohttp

System requirements

  • Make
  • Docker
  • docker-compose

Usage

Building an image

Code Block
languagebash
make docker-build

Run

Code Block
languagebash
make run

Remove running services

Code Block
languagebash
make remove-compose

Running integration tests

Code Block
languagebash
make test-integration

Build sphinx docs based on the docstring description.

Code Block
languagebash
make build-docs

Build sphinx docs based on the docstring description.

Code Block
languagebash
make clean-docs

Elastic indexes description

There are multiple indexes built on service with standard naming patterns:

  • Procedures (k8s_namespace)_procedures_(procedure_type).
    • Example: ``prozorro_dev_procedures_basicsell``
  • Registry:
    • (k8s_namespace)_registry
    • (k8s_namespace)_action
    • (k8s_namespace)_lease

...

Code Block
languagebash
python3 -m prozorro_sale.create_indexes -u localhost -i procedures

...

search/procedures' \
--header 'Content-Type: application/json' \
--data '{
    "page": 1,
    "limit": 100,
    "filters": [
        {
            "field": "sellingMethod",
            "operator": "in",
            "value": [
                "commercialPropertyLease-english",
                "commercialPropertyLease-dutch"
            ]
        }
    ]
}'

byDateModified

Дозволяє шукати обʼєкти процедур по даті останньої зміни обʼєкта

Приклад запиту:

Code Block
curl --location 'https://procedure.prozorro.sale/api/search/procedures' \
--header 'Content-Type: application/json' \
--data '{
    "page": 1,
    "limit": 100,
    "filters": [
        {
            "field": "dateModified",
            "operator": "gt",
            "value": "2025-05-14T00:00:47.00Z"
        }
    ],
    "sort": [
        {
            "field": "datePublished",
            "direction": "desc"
        }
    ]
}'

byStatus

Дозволяє шукати обʼєкти процедур по актуальному статусу обʼєкта

Code Block
curl --location 'https://procedure.prozorro.sale/api/search/procedures' \
--header 'Content-Type: application/json' \
--data '{
    "page": 1,
    "limit": 10,
    "filters": [
        {
            "field": "status",
            "operator": "in",
            "value": [
                "unsuccessful",
                "cancelled"
            ]
        }
    ]
}'

all_available_filters

В цьому запиті Postman можна побачити всі доступні фільтри

  • main index for procedures (name: procedures-<VERSION>, alias: procedures)
  • timestamp index for sync (name: procedures_ts)

CLI script for ops

[More information: ](./docs/cli.md)

Indexing WorkFlow

[More information: ](./docs/indexing-workflow.md)