Returns a list of the concrete Lucene search fields.<p>

@return a list of lucene search fields
542842
public List<CmsLuceneField> getLuceneFields() {

        List<CmsLuceneField> result = new ArrayList<CmsLuceneField>();
        for (CmsSearchField field : getFields()) {
            if (field instanceof CmsLuceneField) {
                result.add((CmsLuceneField)field);
            }
        }
        return result;
    }
1055248
public List<CmsSolrIndex> getSearchIndexesSolr() {

        List<CmsSolrIndex> indexes = new ArrayList<CmsSolrIndex>();
        for (I_CmsSearchIndex index : m_indexes) {
            if (index instanceof CmsSolrIndex) {
                indexes.add((CmsSolrIndex)index);
            }
        }
        return Collections.unmodifiableList(indexes);
    }
913589
public List<CmsSolrIndex> getAllSolrIndexes() {

        List<CmsSolrIndex> result = new ArrayList<CmsSolrIndex>();
        for (String indexName : getIndexNames()) {
            CmsSolrIndex index = getIndexSolr(indexName);
            if (index != null) {
                result.add(index);
            }
        }
        return result;
    }
784170
public JField []getDeclaredFields()
  {
    ArrayList<JavaField> fieldList = getFieldList();
    
    JField[] fields = new JField[fieldList.size()];

    fieldList.toArray(fields);

    return fields;
  }
334056
public function getCMSFields() {

		$fields = parent::getCMSFields();
		Requirements::css('nglasl/silverstripe-extensible-search: client/css/extensible-search.css');

		// Determine the search engines that are available.

		$engines = array();
		foreach(self::config()->custom_search_engines as $engine => $display) {

			// The search engines may define an optional display title.

			if(is_numeric($engine)) {
				$engine = $display;
			}

			// Determine whether the search engines exist.

			if(ClassInfo::exists($engine)) {
				$engines[$engine] = $display;
			}
		}

		// Determine whether the full-text search engine is available.

		$configuration = Config::inst();
		$classes = $configuration->get(FulltextSearchable::class, 'searchable_classes');
		if(is_array($classes) && (count($classes) > 0)) {
			$engines['Full-Text'] = 'Full-Text';
		}

		// Display the search engine selection.

		$fields->addFieldToTab('Root.Main', DropdownField::create(
			'SearchEngine',
			_t('EXTENSIBLE_SEARCH.SEARCH_ENGINE', 'Search Engine'),
			$engines
		)->setHasEmptyDefault(true)->setDescription('This needs to be saved before further customisation is available'), 'Title');

		// Determine whether a search engine has been selected.

		if($this->SearchEngine && isset($engines[$this->SearchEngine])) {

			// Display a search engine specific notice.

			$fields->addFieldToTab('Root.Main', LiteralField::create(
				'SearchEngineNotice',
				"<p class='extensible-search notice'><strong>{$engines[$this->SearchEngine]} Search Page</strong></p>"
			), 'Title');

			// Determine whether the search engine supports hierarchy filtering.

			$hierarchy = $this->supports_hierarchy;
			if($this->SearchEngine !== 'Full-Text') {
				$hierarchy = singleton($this->SearchEngine)->supports_hierarchy;
			}

			// The search engine may only support limited hierarchy filtering for multiple sites.

			if($hierarchy || ClassInfo::exists(Multisites::class)) {

				// Display the search trees selection.

				$fields->addFieldToTab('Root.Main', $tree = TreeMultiselectField::create(
					'SearchTrees',
					_t('EXTENSIBLE_SEARCH.SEARCH_TREES', 'Search Trees'),
					SiteTree::class
				), 'Content');

				// Determine whether the search engine only supports limited hierarchy filtering.

				if(!$hierarchy) {

					// Update the search trees to reflect this.

					$tree->setDisableFunction(function($page) {

						return ($page->ParentID != 0);
					});
					$tree->setDescription('This <strong>search engine</strong> only supports limited hierarchy');
				}
			}

			// Display the sorting selection.

			$fields->addFieldToTab('Root.Main', DropdownField::create(
				'SortBy',
				_t('EXTENSIBLE_SEARCH.SORT_BY', 'Sort By'),
				$this->getSelectableFields()
			), 'Content');
			$fields->addFieldToTab('Root.Main', DropdownField::create(
				'SortDirection',
				_t('EXTENSIBLE_SEARCH.SORT_DIRECTION', 'Sort Direction'),
				array(
					'DESC' => _t('EXTENSIBLE_SEARCH.DESCENDING', 'Descending'),
					'ASC' => _t('EXTENSIBLE_SEARCH.ASCENDING', 'Ascending')
				)
			), 'Content');

			// Display the start with listing selection.

			$fields->addFieldToTab('Root.Main', CheckboxField::create(
				'StartWithListing',
				_t('EXTENSIBLE_SEARCH.START_WITH_LISTING?', 'Start With Listing?')
			)->addExtraClass('start-with-listing'), 'Content');

			// Display the results per page selection.

			$fields->addFieldToTab('Root.Main', NumericField::create(
				'ResultsPerPage',
				_t('EXTENSIBLE_SEARCH.RESULTS_PER_PAGE', 'Results Per Page')
			), 'Content');
		}
		else {

			// The search engine has not been selected.

			$fields->addFieldToTab('Root.Main', LiteralField::create(
				'SearchEngineNotification',
				"<p class='extensible-search notification'><strong>Select a Search Engine</strong></p>"
			), 'Title');
		}

		// The history view shouldn't show the following, as they're not versioned.

		$pageHistory = Controller::has_curr() && (Controller::curr() instanceof CMSPageHistoryController);

		// Determine whether analytics have been enabled.

		if($configuration->get(ExtensibleSearch::class, 'enable_analytics') && !$pageHistory) {

			// Instantiate the analytic summary.

			$fields->findOrMakeTab('Root.SearchAnalytics.Current', _t('EXTENSIBLE_SEARCH.CURRENT', 'Current'));
			$fields->findOrMakeTab('Root.SearchAnalytics')->setTitle(_t('EXTENSIBLE_SEARCH.SEARCH_ANALYTICS', 'Search Analytics'));
			$fields->addFieldToTab('Root.SearchAnalytics.Current', $summary = GridField::create(
				'HistorySummary',
				_t('EXTENSIBLE_SEARCH.SUMMARY', 'Summary'),
				$this->getHistorySummary()
			)->setModelClass(ExtensibleSearch::class));
			$summaryConfiguration = $summary->getConfig();

			// Update the display columns.

			$summaryDisplay = singleton(ExtensibleSearchArchived::class)->fieldLabels();
			$summaryConfiguration->getComponentByType(GridFieldDataColumns::class)->setDisplayFields($summaryDisplay);

			// Instantiate an export button.

			if($this->getHistorySummary()->exists()) {
				$summaryConfiguration->addComponent($summaryExport = new GridFieldExportButton());
				$summaryExport->setExportColumns($summaryDisplay);
			}

			// Update the custom summary fields to be sortable.

			$summaryConfiguration->getComponentByType(GridFieldSortableHeader::class)->setFieldSorting(array(
				'FrequencyPercentage' => 'Frequency'
			));
			$summaryConfiguration->removeComponentsByType(GridFieldFilterHeader::class);

			// Instantiate the analytic history.

			$fields->addFieldToTab('Root.SearchAnalytics.Current', $history = GridField::create(
				'History',
				_t('EXTENSIBLE_SEARCH.HISTORY', 'History'),
				$this->History()
			)->setModelClass(ExtensibleSearch::class));
			$historyConfiguration = $history->getConfig();

			// Update the custom summary fields to be sortable.

			$historyConfiguration->getComponentByType(GridFieldSortableHeader::class)->setFieldSorting(array(
				'Created.Nice' => 'Created',
				'TimeTakenSummary' => 'Time',
				'SearchEngineSummary' => 'SearchEngine'
			));
			$historyConfiguration->removeComponentsByType(GridFieldFilterHeader::class);

			// Instantiate the archived collection of search analytics.

			$archives = $this->Archives();
			if($archives->exists() && $archives->first()->canView()) {
				$fields->findOrMakeTab('Root.SearchAnalytics.Archives', _t('EXTENSIBLE_SEARCH.ARCHIVES', 'Archives'));
				$fields->addFieldToTab('Root.SearchAnalytics.Archives', GridField::create(
					'Archives',
					_t('EXTENSIBLE_SEARCH.ARCHIVES', 'Archives'),
					$archives,
					$archivesConfiguration = GridFieldConfig_RecordEditor::create()
				)->setModelClass(ExtensibleSearchArchive::class));

				// Update the custom summary fields to be sortable.

				$archivesConfiguration->getComponentByType(GridFieldSortableHeader::class)->setFieldSorting(array(
					'TitleSummary' => 'StartingDate'
				));
				$archivesConfiguration->removeComponentsByType(GridFieldFilterHeader::class);
			}
		}

		// Determine whether suggestions have been enabled.

		if($configuration->get(ExtensibleSearchSuggestion::class, 'enable_suggestions') && !$pageHistory) {

			// Appropriately restrict the approval functionality.

			$user = Member::currentUserID();
			if(Permission::checkMember($user, 'EXTENSIBLE_SEARCH_SUGGESTIONS')) {
				Requirements::javascript('nglasl/silverstripe-extensible-search: client/javascript/extensible-search-approval.js');
			}

			// Determine the search page specific suggestions.

			$fields->findOrMakeTab('Root.SearchSuggestions', _t('EXTENSIBLE_SEARCH.SEARCH_SUGGESTIONS', 'Search Suggestions'));
			$fields->addFieldToTab('Root.SearchSuggestions', GridField::create(
				'Suggestions',
				_t('EXTENSIBLE_SEARCH.SUGGESTIONS', 'Suggestions'),
				$this->Suggestions(),
				$suggestionsConfiguration =
					singleton(ExtensibleSearchSuggestion::class)->canEdit() ? GridFieldConfig_RecordEditor::create() : GridFieldConfig_Base::create()
			)->setModelClass(ExtensibleSearchSuggestion::class));

			// Update the custom summary fields to be sortable.

			$suggestionsConfiguration->getComponentByType(GridFieldSortableHeader::class)->setFieldSorting(array(
				'FrequencySummary' => 'Frequency',
				'FrequencyPercentage' => 'Frequency',
				'ApprovedField' => 'Approved'
			));
			$suggestionsConfiguration->removeComponentsByType(GridFieldFilterHeader::class);
		}

		// Allow extension customisation.

		$this->extend('updateExtensibleSearchPageCMSFields', $fields);
		return $fields;
	}
213438
public List<CmsListItem> getAllContent() {

        if (m_metadata.isSelfManaged()) {
            if (m_filteredItems != null) {
                return Collections.unmodifiableList(m_filteredItems);
            } else {
                return Collections.emptyList();
            }
        } else {
            if (m_originalItems != null) {
                return Collections.unmodifiableList(m_originalItems);
            } else {
                return Collections.emptyList();
            }
        }
    }
288293
public static List<CmsRelationType> getAll() {

        List<CmsRelationType> all = new ArrayList<CmsRelationType>(Arrays.asList(VALUE_ARRAY));
        all.addAll(OpenCms.getResourceManager().getRelationTypes());
        return Collections.unmodifiableList(all);
    }
184125
public static List<Field> findFields(final Class<?> clazz) {
        List<Field> foundFields = new ArrayList<>();
        Class<?> searchType = clazz;
        while (!Object.class.equals(searchType) && (searchType != null)) {
            Field[] fields = searchType.getDeclaredFields();
            for (Field field : fields) {
                field.setAccessible(true);
                foundFields.add(field);
            }
            searchType = searchType.getSuperclass();
        }
        return foundFields;
    }
1085758
protected List<String> getDocumentTypes() {

        List<String> names = new ArrayList<String>();
        for (Iterator<I_CmsDocumentFactory> i = m_documentTypes.values().iterator(); i.hasNext();) {
            I_CmsDocumentFactory factory = i.next();
            names.add(factory.getName());
        }
        return names;
    }
938428
public List<CmsDetailPageInfo> toList() {

        List<CmsDetailPageInfo> result = new ArrayList<CmsDetailPageInfo>();
        for (String key : m_map.keySet()) {
            for (CmsDetailPageInfo info : m_map.get(key)) {
                result.add(info);
            }
        }
        return result;
    }
689542
private List<I_CmsSearchFieldMapping> getMappings() {

        CmsSearchManager manager = OpenCms.getSearchManager();
        I_CmsSearchFieldConfiguration fieldConfig = manager.getFieldConfiguration(getParamFieldconfiguration());
        CmsLuceneField field;
        List<I_CmsSearchFieldMapping> result = null;
        Iterator<CmsSearchField> itFields;
        if (fieldConfig != null) {
            itFields = fieldConfig.getFields().iterator();
            while (itFields.hasNext()) {
                field = (CmsLuceneField)itFields.next();
                if (field.getName().equals(getParamField())) {
                    result = field.getMappings();
                }
            }
        } else {
            result = Collections.emptyList();
            if (LOG.isErrorEnabled()) {
                LOG.error(
                    Messages.get().getBundle().key(
                        Messages.ERR_SEARCHINDEX_EDIT_MISSING_PARAM_1,
                        A_CmsFieldConfigurationDialog.PARAM_FIELDCONFIGURATION));
            }
        }
        return result;
    }
1359171
private List<CmsSelectWidgetOption> getFieldConfigurationWidgetConfiguration() {

        List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>();
        if (getSearchIndexIndex() instanceof CmsSolrIndex) {
            List<CmsSolrFieldConfiguration> fieldConfigurations = m_searchManager.getFieldConfigurationsSolr();
            for (CmsSearchFieldConfiguration config : fieldConfigurations) {
                CmsSelectWidgetOption option = new CmsSelectWidgetOption(
                    config.getName(),
                    (config.getName()).equals(CmsSearchFieldConfiguration.STR_STANDARD));
                result.add(option);
            }
        } else {
            List<CmsLuceneFieldConfiguration> fieldConfigurations = m_searchManager.getFieldConfigurationsLucene();
            for (CmsSearchFieldConfiguration config : fieldConfigurations) {
                CmsSelectWidgetOption option = new CmsSelectWidgetOption(
                    config.getName(),
                    (config.getName()).equals(CmsSearchFieldConfiguration.STR_STANDARD));
                result.add(option);
            }
        }
        return result;
    }
433092
public List<FieldRef> getFields() {
        Map<String,FieldRef> fields = new LinkedHashMap<String,FieldRef>();
        for (Klass<?> k = this; k!=null; k=k.getSuperClass()) {
            for (FieldRef f : k.getDeclaredFields()) {
                String name = f.getName();
                if (!fields.containsKey(name) && f.isRoutable()) {
                    fields.put(name,f);
                }
            }
        }

        return new ArrayList<FieldRef>(fields.values());
    }
840750
public List<CmsSearchResult> getSearchResult() {

        if ((m_cms != null)
            && (m_result == null)
            && (m_parameters.getIndex() != null)
            && (m_parameters.isIgnoreQuery()
                || CmsStringUtil.isNotEmpty(m_parameters.getQuery())
                || CmsStringUtil.isNotEmpty(m_parameters.getParsedQuery())
                || (m_parameters.getFieldQueries() != null))) {

            if (!m_parameters.isIgnoreQuery()
                && CmsStringUtil.isEmpty(m_parameters.getParsedQuery())
                && (getQueryLength() > 0)) {

                if (m_parameters.getFieldQueries() != null) {
                    // check all field queries if the length of the query is ok
                    for (CmsSearchParameters.CmsSearchFieldQuery fq : m_parameters.getFieldQueries()) {
                        for (String keyword : fq.getSearchTerms()) {
                            if (CmsStringUtil.isEmpty(keyword) || (keyword.trim().length() < getQueryLength())) {

                                m_lastException = new CmsSearchException(
                                    Messages.get().container(
                                        Messages.ERR_QUERY_TOO_SHORT_1,
                                        new Integer(getQueryLength())));

                                return null;
                            }
                        }
                    }

                } else if (m_parameters.getQuery().trim().length() < getQueryLength()) {

                    m_lastException = new CmsSearchException(
                        Messages.get().container(Messages.ERR_QUERY_TOO_SHORT_1, new Integer(getQueryLength())));

                    return null;
                }
            }

            try {

                CmsSearchResultList result = m_parameters.getSearchIndex().search(m_cms, getParameters());

                if (result.size() > 0) {

                    m_result = result;
                    m_searchResultCount = result.getHitCount();
                    m_categoriesFound = result.getCategories();

                    // re-caluclate the number of pages for this search result
                    m_pageCount = m_searchResultCount / m_parameters.getMatchesPerPage();
                    if ((m_searchResultCount % m_parameters.getMatchesPerPage()) != 0) {
                        m_pageCount++;
                    }

                    // re-calculate the URLs to browse forward and backward in the search result
                    String url = m_cms.getRequestContext().getUri() + m_parameters.toQueryString() + "&searchPage=";
                    if (m_parameters.getSearchPage() > 1) {
                        m_prevUrl = url + (m_parameters.getSearchPage() - 1);
                    }
                    if (m_parameters.getSearchPage() < m_pageCount) {
                        m_nextUrl = url + (m_parameters.getSearchPage() + 1);
                    }
                } else {
                    m_result = Collections.emptyList();
                    m_searchResultCount = 0;
                    m_categoriesFound = null;
                    m_pageCount = 0;
                    m_prevUrl = null;
                    m_nextUrl = null;
                }
            } catch (Exception exc) {

                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_SEARCHING_FAILED_0), exc);
                }

                m_result = null;
                m_searchResultCount = 0;
                m_pageCount = 0;

                m_lastException = exc;
            }
        }

        return m_result;
    }
157365
public List<I_CmsSearchFieldConfiguration> getFieldConfigurations() {

        List<I_CmsSearchFieldConfiguration> result = new ArrayList<I_CmsSearchFieldConfiguration>(
            m_fieldConfigurations.values());
        Collections.sort(result);
        return Collections.unmodifiableList(result);
    }
497647
public Collection<FieldWithHighlightParameters> getFieldsWithHighlightParameters() {

		List<FieldWithHighlightParameters> result = new ArrayList<>();
		for (Field candidate : fields) {

			if (candidate instanceof FieldWithHighlightParameters) {
				result.add((FieldWithHighlightParameters) candidate);
			}
		}

		return result;
	}
300625
public static Field[] getAllFields(Class<?> clz) {
    List<Field> list = new ArrayList<>();
    do {
      list.addAll(Arrays.asList(clz.getDeclaredFields()));
    } while ((clz = clz.getSuperclass()) != null);
    return list.toArray(new Field[list.size()]);
  }