Skip to content

Details about some important class

Xiaoling edited this page Aug 16, 2016 · 1 revision

Details about some important class:

SearchBuilder.php

Parse and send parameters to Elasticsearch class. Get search results from Elasticsearch class.

This class has four major functions:

  • setElasticSearchIndexes

    Get elasticsearch indexes for the selected repositories. Output: a string, index names concatenated by comma.

  • setElasticSearchResults

    Get elasticsearch results for selected repositories. Input: a string, index names concatenated by comma. Ouput: an array, search results for each selected repository

  • setTotalRows

    Get total number of search results for all selected repositories. Input: an array, output of setElasticSearchResults() function Output: int

  • setRepositoryRows Get number of search results for each repository Input: an array, output of setElasticSearchResults() function Output: an array

ConstructSearchView.php

Construct the search results and hyperlinks for the search.php page @input an instance of SearchBuilder class @output $this->repositoryFilter: an array of data for repository filter $this->dataTypeFilter: an array of data for data type filter $this->searchResults: an array of data for search results

  • setRepositoryFilter

    Generate data for repository filter

  • setDataTypeFilter

    Generate data for data type filter

  • setSearchResults Generate search data for displaying

Clone this wiki locally