Learning opportunities index

Learning opportunities, services or courses are the basic entity for learning.

Creating index

To create an index PUT to https://search.eduplex.eu/example being example the index name. You can add the mapping fields in the body.

See an example here: https://gitlab.com/eduplex-api/opensearch/-/blob/main/files/index_mapping.json

Retrieving entries from index

To search on the index you can do a GET to https://search.eduplex.eu/example/_search being example the index name and with a body like this it will return all documents from the index.

{
  "query": {
    "match_all": {}
  }
}

We also have a proxy on our API to build more complex queries allowing to filter, return facets or rank results. Our endpoint allows the following parameters:

  • page: pagination number.

  • limit: number of documents per page.

  • text: text to search.

  • semantic_text: same as previous parameter but using vector search with exact knn. You can not use both at the same time.

  • sort_by: it allows to sort by the following fields:

    • title

    • total_price

    • ratings

    • next_course

  • order: it changes the sorting criteria (asc or desc)

and the following filters:

  • facets: an object with different facets to filter. E.g.{ type: 'online', city: 'Viena' }.

  • tag: returns only events associated to a specific tag.

  • category: returns only events associated to a specific category.

  • seller_id: filters by the provider of the learning opportunities.

  • is_internal: returns only internal events.

  • has_exclusive_tag: if false returns only events without exclusive tags.

  • exclusive_tags: if previous filter is set to false, also returns events with the specified tags.

Examples

We use some special parameters to modify the results:

  • track_scores: it forces to calculate the score of the documents.

  • functions: it allows to customize documents ranking scores.

  • score_mode: how to calculate the result from all the functions.

  • boost_mode: how to apply the score_mode to the document score.

  • aggs: facets to be returned.

Text search query

Semantic search query

Last updated