Logo

User documentation

  • Inventory
  • Network
  • Task
  • Profile
  • API
  • Changelog

Developer documentation

  • Design
  • Deployment
  • Endpoints
  • Implementation
    • app.models
    • app.commands
    • app.decorators
    • app.search
    • app.tasks
    • app.user.views
    • app.inventory.views
    • app.network.views
CSEntry
  • »
  • Implementation »
  • app.search
  • View page source

app.search

This module implements the search interface.

copyright
  1. 2018 European Spallation Source ERIC

license

BSD 2-Clause, see LICENSE for more details.

app.search.add_to_index(index, body)[source]

Add a document to an index

app.search.create_index(index, mapping, **kwargs)[source]

Create an index with the given mapping

app.search.delete_index(index, **kwargs)[source]

Delete the given index

app.search.query_index(index, query, page=1, per_page=20, sort=None)[source]

Run a search query on the index

Return a BaseQuery (with the ids found) and the total number of hits as a tuple

app.search.remove_from_index(index, id)[source]

Remove a document from the index

app.search.update_document(index, id, partial_doc)[source]

Update partially a document

Parameters
  • index – elasticsearch index

  • id – document id

  • partial_doc (dict) – fields to update

Previous Next

© Copyright 2020, European Spallation Source ERIC.

Built with Sphinx using a theme provided by Read the Docs.