Java Code Examples for org.alfresco.service.cmr.search.SearchParameters#getLanguage()
The following examples show how to use
org.alfresco.service.cmr.search.SearchParameters#getLanguage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PropertyValueConstraint.java From alfresco-repository with GNU Lesser General Public License v3.0 | 6 votes |
@Override public SearchParameters applyDecorations(ActualEnvironment environment, SearchParameters searchParameters, VirtualQuery query) throws VirtualizationException { // TODO: allow custom language and not only constraint appliers if (SearchService.LANGUAGE_FTS_ALFRESCO.equals(searchParameters.getLanguage())) { SearchParameters searchParametersCopy = searchParameters.copy(); return applyFTS(searchParametersCopy); } else { throw new VirtualizationException("Unsupported constrating language " + searchParameters.getLanguage()); } }
Example 2
Source File: IgnoreConstraint.java From alfresco-repository with GNU Lesser General Public License v3.0 | 6 votes |
@Override protected SearchParameters applyDecorations(ActualEnvironment environment, SearchParameters searchParameters, VirtualQuery query) { if ((ignoreAspectQNames != null && !ignoreAspectQNames.isEmpty()) || (ignoreTypeNames != null && !ignoreTypeNames.isEmpty())) { if (SearchService.LANGUAGE_FTS_ALFRESCO.equals(searchParameters.getLanguage())) { SearchParameters searchParametersCopy = searchParameters.copy(); return applyFTSDecorations(searchParametersCopy, environment.getNamespacePrefixResolver()); } else { throw new VirtualizationException("Unsupported constrating language " + searchParameters.getLanguage()); } } else { return searchParameters; } }
Example 3
Source File: SolrSearchService.java From alfresco-repository with GNU Lesser General Public License v3.0 | 5 votes |
@Override public ResultSet query(SearchParameters searchParameters) { if(searchParameters.getStores().size() == 0) { throw new IllegalStateException("At least one store must be defined to search"); } String parameterisedQueryString; if (searchParameters.getQueryParameterDefinitions().size() > 0) { Map<QName, QueryParameterDefinition> map = new HashMap<QName, QueryParameterDefinition>(); for (QueryParameterDefinition qpd : searchParameters.getQueryParameterDefinitions()) { map.put(qpd.getQName(), qpd); } parameterisedQueryString = parameterise(searchParameters.getQuery(), map, null, namespacePrefixResolver); } else { parameterisedQueryString = searchParameters.getQuery(); } // TODO: add another property so the set query is not changed ... // May be good to return the query as run ?? searchParameters.setQuery(parameterisedQueryString); LuceneQueryLanguageSPI language = queryLanguages.get(searchParameters.getLanguage().toLowerCase()); if (language != null) { return language.executeQuery(searchParameters); } else { throw new SearcherException("Unknown query language: " + searchParameters.getLanguage()); } }
Example 4
Source File: FilesFoldersConstraint.java From alfresco-repository with GNU Lesser General Public License v3.0 | 5 votes |
@Override protected SearchParameters applyDecorations(ActualEnvironment environment, SearchParameters searchParameters, VirtualQuery query) { String queryString = searchParameters.getQuery(); String language = searchParameters.getLanguage(); String filteredQuery = filter(language, queryString, files, folders); SearchParameters searchParametersCopy = searchParameters.copy(); searchParametersCopy.setQuery(filteredQuery); return searchParametersCopy; }