Skip to content

Datagateway Search

esl-lewis edited this page Mar 6, 2020 · 11 revisions

The datagateway-search plugin is split into two logical components: the search box and the search table. The search box handles modifying and sending search requests while the table presents the retrieved data. These are contained and formatted in an overall component src/searchPageContainer.tsx which can be seen in src/App.tsx

Search Box

The search box is a material-ui grid made up of several sub-components which can be inspected in src/search/ :

  • SearchTextBox
  • SelectDates
  • CheckboxesGroup
  • SearchButton

The first three components take user input to modify the parameters sent to the search library Lucene. Users may filter by date, search string and the type of data entity they would like to search (Dataset, Datafile and Investigation).

These parameters are saved to the Redux store for retrieval and use by the SearchButton. This component contains both functionality for rendering the user interface search button and for handling the Lucene request. (It is good practice to separate UI from functionality so this will require a refactor.) The SearchButton formats the input parameters to build and send a request to Lucene which then returns a list of matching data Ids.

Search Table

On sending a search request the searchPageTable will render a tabpanel containing a table for each of the entity types:

  • datafileSearchTable
  • datasetSearchTable
  • investigationSearchTable

The data is retrieved using the ids provided from the Lucene search. Sending a request with blank fields will default to retrieving the entire dataset. The search table uses functions imported from datagateway-common and so is similar in performance to datagateway-table which also depends on these shared resources. As such descriptions of the behaviour of the column filters and cart can be found at the dg-table wiki page.

Clone this wiki locally