Search in sources :

Example 6 with SearchRequestContext

use of org.alfresco.rest.api.search.context.SearchRequestContext in project alfresco-remote-api by Alfresco.

the class SearchMapperTests method testMandatory.

@Test(expected = IllegalArgumentException.class)
public void testMandatory() throws Exception {
    SearchRequestContext searchRequest = SearchRequestContext.from(SearchQuery.EMPTY);
    SearchParameters searchParameters = searchMapper.toSearchParameters(ResultMapperTests.EMPTY_PARAMS, SearchQuery.EMPTY, searchRequest);
}
Also used : SearchParameters(org.alfresco.service.cmr.search.SearchParameters) SearchRequestContext(org.alfresco.rest.api.search.context.SearchRequestContext) Test(org.junit.Test)

Example 7 with SearchRequestContext

use of org.alfresco.rest.api.search.context.SearchRequestContext in project alfresco-remote-api by Alfresco.

the class SearchApiWebscript method execute.

@Override
public void execute(WebScriptRequest webScriptRequest, WebScriptResponse webScriptResponse) throws IOException {
    try {
        // Turn JSON into a Java object respresentation
        SearchQuery searchQuery = extractJsonContent(webScriptRequest, assistant.getJsonHelper(), SearchQuery.class);
        // Parse the parameters
        Params params = getParams(webScriptRequest, searchQuery.getFields(), searchQuery.getInclude(), searchQuery.getPaging());
        // Make a copy of the request
        SearchRequestContext searchRequestContext = SearchRequestContext.from(searchQuery);
        // Turn the SearchQuery json into the Java SearchParameters object
        SearchParameters searchParams = searchMapper.toSearchParameters(params, searchQuery, searchRequestContext);
        // Call searchService
        ResultSet results = searchService.query(searchParams);
        // Turn solr results into JSON
        CollectionWithPagingInfo<Node> resultJson = resultMapper.toCollectionWithPagingInfo(params, searchRequestContext, searchQuery, results);
        // Post-process the request and pass in params, eg. params.getFilter()
        Object toRender = helper.processAdditionsToTheResponse(null, null, null, params, resultJson);
        // Write response
        setResponse(webScriptResponse, DEFAULT_SUCCESS);
        renderJsonResponse(webScriptResponse, toRender, assistant.getJsonHelper());
    } catch (Exception exception) {
        renderException(exception, webScriptResponse, assistant);
    }
}
Also used : SearchQuery(org.alfresco.rest.api.search.model.SearchQuery) SearchParameters(org.alfresco.service.cmr.search.SearchParameters) Node(org.alfresco.rest.api.model.Node) ResultSet(org.alfresco.service.cmr.search.ResultSet) Params(org.alfresco.rest.framework.resource.parameters.Params) SearchRequestContext(org.alfresco.rest.api.search.context.SearchRequestContext) IOException(java.io.IOException)

Example 8 with SearchRequestContext

use of org.alfresco.rest.api.search.context.SearchRequestContext in project alfresco-remote-api by Alfresco.

the class ResultMapper method toSearchContext.

/**
 * Uses the results from Solr to set the Search Context
 * @param SolrJSONResultSet
 * @param searchQuery
 * @return SearchContext
 */
public SearchContext toSearchContext(SolrJSONResultSet solrResultSet, SearchRequestContext searchRequestContext, SearchQuery searchQuery, int notFound) {
    SearchContext context = null;
    Map<String, Integer> facetQueries = solrResultSet.getFacetQueries();
    List<GenericFacetResponse> facets = new ArrayList<>();
    List<FacetQueryContext> facetResults = null;
    SpellCheckContext spellCheckContext = null;
    List<FacetFieldContext> ffcs = new ArrayList<FacetFieldContext>();
    if (searchQuery == null) {
        throw new IllegalArgumentException("searchQuery can't be null");
    }
    // Facet queries
    if (facetQueries != null && !facetQueries.isEmpty()) {
        // If group by field populated in query facet return bucketing into facet field.
        List<GenericFacetResponse> facetQueryForFields = getFacetBucketsFromFacetQueries(facetQueries, searchQuery);
        if (hasGroup(searchQuery) || FacetFormat.V2 == searchQuery.getFacetFormat()) {
            facets.addAll(facetQueryForFields);
        } else {
            // Return the old way facet query with no bucketing.
            facetResults = new ArrayList<>(facetQueries.size());
            for (Entry<String, Integer> fq : facetQueries.entrySet()) {
                String filterQuery = null;
                if (searchQuery.getFacetQueries() != null) {
                    Optional<FacetQuery> found = searchQuery.getFacetQueries().stream().filter(facetQuery -> fq.getKey().equals(facetQuery.getLabel())).findFirst();
                    filterQuery = found.isPresent() ? found.get().getQuery() : fq.getKey();
                }
                facetResults.add(new FacetQueryContext(fq.getKey(), filterQuery, fq.getValue()));
            }
        }
    }
    // Field Facets
    Map<String, List<Pair<String, Integer>>> facetFields = solrResultSet.getFieldFacets();
    if (FacetFormat.V2 == searchQuery.getFacetFormat()) {
        facets.addAll(getFacetBucketsForFacetFieldsAsFacets(facetFields, searchQuery));
    } else {
        ffcs.addAll(getFacetBucketsForFacetFields(facetFields, searchQuery));
    }
    Map<String, List<Pair<String, Integer>>> facetInterval = solrResultSet.getFacetIntervals();
    facets.addAll(getGenericFacetsForIntervals(facetInterval, searchQuery));
    Map<String, List<Map<String, String>>> facetRanges = solrResultSet.getFacetRanges();
    facets.addAll(RangeResultMapper.getGenericFacetsForRanges(facetRanges, searchQuery.getFacetRanges()));
    List<GenericFacetResponse> stats = getFieldStats(searchRequestContext, solrResultSet.getStats());
    List<GenericFacetResponse> pimped = getPivots(searchRequestContext, solrResultSet.getPivotFacets(), stats);
    facets.addAll(pimped);
    facets.addAll(stats);
    // Spelling
    SpellCheckResult spell = solrResultSet.getSpellCheckResult();
    if (spell != null && spell.getResultName() != null && !spell.getResults().isEmpty()) {
        spellCheckContext = new SpellCheckContext(spell.getResultName(), spell.getResults());
    }
    // Put it all together
    context = new SearchContext(solrResultSet.getLastIndexedTxId(), facets, facetResults, ffcs, spellCheckContext, searchRequestContext.includeRequest() ? searchQuery : null);
    return isNullContext(context) ? null : context;
}
Also used : Arrays(java.util.Arrays) SearchContext(org.alfresco.rest.api.search.context.SearchContext) FacetQuery(org.alfresco.rest.api.search.model.FacetQuery) GenericBucket(org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericBucket) LIVE_NODES(org.alfresco.rest.api.search.impl.StoreMapper.LIVE_NODES) Paging(org.alfresco.rest.framework.resource.parameters.Paging) FacetFormat(org.alfresco.service.cmr.search.FacetFormat) JSONException(org.json.JSONException) JSONObject(org.json.JSONObject) Params(org.alfresco.rest.framework.resource.parameters.Params) Node(org.alfresco.rest.api.model.Node) Map(java.util.Map) HISTORY(org.alfresco.rest.api.search.impl.StoreMapper.HISTORY) METRIC_TYPE(org.alfresco.repo.search.impl.solr.facet.facetsresponse.Metric.METRIC_TYPE) ResultSet(org.alfresco.service.cmr.search.ResultSet) TupleEntry(org.alfresco.rest.api.search.model.TupleEntry) DeletedNodes(org.alfresco.rest.api.DeletedNodes) FacetQueryContext(org.alfresco.rest.api.search.context.FacetQueryContext) Set(java.util.Set) Collectors(java.util.stream.Collectors) Serializable(java.io.Serializable) List(java.util.List) Version2Model(org.alfresco.repo.version.Version2Model) IntervalSet(org.alfresco.service.cmr.search.IntervalSet) EntityNotFoundException(org.alfresco.rest.framework.core.exceptions.EntityNotFoundException) CollectionWithPagingInfo(org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo) SpellCheckContext(org.alfresco.rest.api.search.context.SpellCheckContext) Bucket(org.alfresco.rest.api.search.context.FacetFieldContext.Bucket) Entry(java.util.Map.Entry) Optional(java.util.Optional) Nodes(org.alfresco.rest.api.Nodes) LogFactory(org.apache.commons.logging.LogFactory) SearchSQLQuery(org.alfresco.rest.api.search.model.SearchSQLQuery) NodeVersionsRelation(org.alfresco.rest.api.nodes.NodeVersionsRelation) TupleList(org.alfresco.rest.api.search.model.TupleList) DELETED(org.alfresco.rest.api.search.impl.StoreMapper.DELETED) Metric(org.alfresco.repo.search.impl.solr.facet.facetsresponse.Metric) Interval(org.alfresco.service.cmr.search.Interval) SearchRequestContext(org.alfresco.rest.api.search.context.SearchRequestContext) SimpleMetric(org.alfresco.repo.search.impl.solr.facet.facetsresponse.SimpleMetric) NodeRef(org.alfresco.service.cmr.repository.NodeRef) Version(org.alfresco.service.cmr.version.Version) UserInfo(org.alfresco.rest.api.model.UserInfo) HashMap(java.util.HashMap) SearchEntry(org.alfresco.rest.api.search.model.SearchEntry) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) InvalidNodeRefException(org.alfresco.service.cmr.repository.InvalidNodeRefException) FacetField(org.alfresco.rest.api.search.model.FacetField) QName(org.alfresco.service.namespace.QName) RangeResultMapper(org.alfresco.repo.search.impl.solr.facet.facetsresponse.RangeResultMapper) PropertyLookupRegistry(org.alfresco.rest.api.lookups.PropertyLookupRegistry) ServiceRegistry(org.alfresco.service.ServiceRegistry) Pair(org.alfresco.util.Pair) FilteringResultSet(org.alfresco.repo.security.permissions.impl.acegi.FilteringResultSet) HighlightEntry(org.alfresco.rest.api.search.model.HighlightEntry) FacetFieldContext(org.alfresco.rest.api.search.context.FacetFieldContext) FACET_TYPE(org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericFacetResponse.FACET_TYPE) SearchQuery(org.alfresco.rest.api.search.model.SearchQuery) VERSIONS(org.alfresco.rest.api.search.impl.StoreMapper.VERSIONS) ResultSetRow(org.alfresco.service.cmr.search.ResultSetRow) Log(org.apache.commons.logging.Log) Collections(java.util.Collections) SolrJSONResultSet(org.alfresco.repo.search.impl.lucene.SolrJSONResultSet) SpellCheckResult(org.alfresco.service.cmr.search.SpellCheckResult) JSONArray(org.json.JSONArray) GenericFacetResponse(org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericFacetResponse) FacetQueryContext(org.alfresco.rest.api.search.context.FacetQueryContext) FacetFieldContext(org.alfresco.rest.api.search.context.FacetFieldContext) GenericFacetResponse(org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericFacetResponse) ArrayList(java.util.ArrayList) SearchContext(org.alfresco.rest.api.search.context.SearchContext) SpellCheckResult(org.alfresco.service.cmr.search.SpellCheckResult) FacetQuery(org.alfresco.rest.api.search.model.FacetQuery) List(java.util.List) TupleList(org.alfresco.rest.api.search.model.TupleList) ArrayList(java.util.ArrayList) SpellCheckContext(org.alfresco.rest.api.search.context.SpellCheckContext)

Example 9 with SearchRequestContext

use of org.alfresco.rest.api.search.context.SearchRequestContext in project alfresco-remote-api by Alfresco.

the class SearchMapper method buildPivotKeys.

protected void buildPivotKeys(List<String> pivotKeys, Pivot aPivot, List<StatsRequestParameters> stats, FacetFields facetFields, List<RangeParameters> ranges, SearchRequestContext searchRequestContext) {
    if (aPivot == null)
        return;
    String pivotKey = null;
    ParameterCheck.mandatoryString("pivot key", aPivot.getKey());
    if (facetFields.getFacets() != null && !facetFields.getFacets().isEmpty()) {
        Optional<FacetField> found = facetFields.getFacets().stream().filter(queryable -> aPivot.getKey().equals(queryable.getLabel() != null ? queryable.getLabel() : queryable.getField())).findFirst();
        if (found.isPresent()) {
            pivotKey = aPivot.getKey();
            if (searchRequestContext.getPivotKeys().containsValue(pivotKey)) {
                throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[] { ": Duplicate pivot parameter " + aPivot.getKey() + "" });
            }
            pivotKeys.add(found.get().getField());
            facetFields.getFacets().remove(found.get());
            searchRequestContext.getPivotKeys().put(found.get().getField(), pivotKey);
        }
    }
    if (pivotKey == null && ((aPivot.getPivots() == null) || aPivot.getPivots().isEmpty())) {
        // It is the last one so it can reference stats or range
        if (stats != null && !stats.isEmpty()) {
            Optional<StatsRequestParameters> foundStat = stats.stream().filter(stas -> aPivot.getKey().equals(stas.getLabel() != null ? stas.getLabel() : stas.getField())).findFirst();
            if (foundStat.isPresent()) {
                pivotKey = aPivot.getKey();
                if (pivotKeys.isEmpty()) {
                    throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[] { ": Stats key " + pivotKey + " cannot be used here" });
                }
                pivotKeys.add(pivotKey);
                searchRequestContext.getPivotKeys().put(pivotKey, pivotKey);
            }
        }
        if (ranges != null && !ranges.isEmpty()) {
            for (RangeParameters aRange : ranges) {
                if (aPivot.getKey().equals(aRange.getLabel())) {
                    pivotKey = aPivot.getKey();
                    if (pivotKeys.isEmpty()) {
                        throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[] { ": Range key " + pivotKey + " cannot be used here" });
                    }
                    pivotKeys.add(pivotKey);
                    searchRequestContext.getPivotKeys().put(pivotKey, pivotKey);
                }
            }
        }
    }
    if (pivotKey == null) {
        String invalidMessage = searchRequestContext.getPivotKeys().values().contains(aPivot.getKey()) ? " cannot be used more than once." : " does not reference a facet Field, range or stats.";
        throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[] { ": Pivot parameter " + aPivot.getKey() + invalidMessage });
    }
    if (aPivot.getPivots() != null && !aPivot.getPivots().isEmpty() && aPivot.getPivots().size() > 1) {
        throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[] { ": Currently only 1 nested pivot is supported, you have " + aPivot.getPivots().size() });
    }
    aPivot.getPivots().forEach(subPivot -> {
        buildPivotKeys(pivotKeys, subPivot, stats, facetFields, ranges, searchRequestContext);
    });
}
Also used : Arrays(java.util.Arrays) FacetQuery(org.alfresco.rest.api.search.model.FacetQuery) Pivot(org.alfresco.rest.api.search.model.Pivot) Paging(org.alfresco.rest.framework.resource.parameters.Paging) PARAM_INCLUDE_PROPERTIES(org.alfresco.rest.api.Nodes.PARAM_INCLUDE_PROPERTIES) RangeParameters(org.alfresco.service.cmr.search.RangeParameters) Template(org.alfresco.rest.api.search.model.Template) IntervalParameters(org.alfresco.service.cmr.search.IntervalParameters) Limits(org.alfresco.rest.api.search.model.Limits) Matcher(java.util.regex.Matcher) Params(org.alfresco.rest.framework.resource.parameters.Params) Locale(java.util.Locale) Map(java.util.Map) LANGUAGE_FTS_ALFRESCO(org.alfresco.service.cmr.search.SearchService.LANGUAGE_FTS_ALFRESCO) Scope(org.alfresco.rest.api.search.model.Scope) PARAM_INCLUDE_PATH(org.alfresco.rest.api.Nodes.PARAM_INCLUDE_PATH) Localization(org.alfresco.rest.api.search.model.Localization) TimeZone(java.util.TimeZone) Set(java.util.Set) FacetFields(org.alfresco.rest.api.search.model.FacetFields) Collectors(java.util.stream.Collectors) ZoneId(java.time.ZoneId) IntervalSet(org.alfresco.service.cmr.search.IntervalSet) List(java.util.List) LuceneQueryLanguageSPI(org.alfresco.repo.search.impl.lucene.LuceneQueryLanguageSPI) PARAM_INCLUDE_ALLOWABLEOPERATIONS(org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ALLOWABLEOPERATIONS) Optional(java.util.Optional) Default(org.alfresco.rest.api.search.model.Default) FilterQuery(org.alfresco.rest.api.search.model.FilterQuery) SortDef(org.alfresco.rest.api.search.model.SortDef) LimitBy(org.alfresco.service.cmr.search.LimitBy) PARAM_INCLUDE_ISLINK(org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLINK) Interval(org.alfresco.service.cmr.search.Interval) FieldFacet(org.alfresco.service.cmr.search.SearchParameters.FieldFacet) SearchRequestContext(org.alfresco.rest.api.search.context.SearchRequestContext) Collectors.groupingBy(java.util.stream.Collectors.groupingBy) GeneralHighlightParameters(org.alfresco.service.cmr.search.GeneralHighlightParameters) Function(java.util.function.Function) ArrayList(java.util.ArrayList) FieldFacetSort(org.alfresco.service.cmr.search.SearchParameters.FieldFacetSort) PARAM_INCLUDE_ASPECTNAMES(org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASPECTNAMES) ParameterCheck(org.alfresco.util.ParameterCheck) StatsRequestParameters(org.alfresco.service.cmr.search.StatsRequestParameters) FacetField(org.alfresco.rest.api.search.model.FacetField) LANGUAGE_LUCENE(org.alfresco.service.cmr.search.SearchService.LANGUAGE_LUCENE) SortType(org.alfresco.service.cmr.search.SearchParameters.SortDefinition.SortType) StoreRef(org.alfresco.service.cmr.repository.StoreRef) PARAM_INCLUDE_ASSOCIATION(org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASSOCIATION) FieldFacetMethod(org.alfresco.service.cmr.search.SearchParameters.FieldFacetMethod) LANGUAGE_CMIS_ALFRESCO(org.alfresco.service.cmr.search.SearchService.LANGUAGE_CMIS_ALFRESCO) AlfrescoRuntimeException(org.alfresco.error.AlfrescoRuntimeException) Operator(org.alfresco.service.cmr.search.SearchParameters.Operator) Query(org.alfresco.rest.api.search.model.Query) Collectors.toList(java.util.stream.Collectors.toList) SearchQuery(org.alfresco.rest.api.search.model.SearchQuery) SortDefinition(org.alfresco.service.cmr.search.SearchParameters.SortDefinition) Spelling(org.alfresco.rest.api.search.model.Spelling) SearchParameters(org.alfresco.service.cmr.search.SearchParameters) InvalidArgumentException(org.alfresco.rest.framework.core.exceptions.InvalidArgumentException) InvalidArgumentException(org.alfresco.rest.framework.core.exceptions.InvalidArgumentException) FacetField(org.alfresco.rest.api.search.model.FacetField) StatsRequestParameters(org.alfresco.service.cmr.search.StatsRequestParameters) RangeParameters(org.alfresco.service.cmr.search.RangeParameters)

Example 10 with SearchRequestContext

use of org.alfresco.rest.api.search.context.SearchRequestContext in project alfresco-remote-api by Alfresco.

the class ResultMapperTests method testFacetingGroupResponseV1.

@Test
public /**
 * Test facet group with out facet fields
 * @throws Exception
 */
void testFacetingGroupResponseV1() throws Exception {
    String jsonQuery = "{\"query\": {\"query\": \"alfresco\"}, \"facetFormat\":\"V1\"," + "\"facetQueries\": [" + "{\"query\": \"content.size:[o TO 102400]\", \"label\": \"small\"}," + "{\"query\": \"content.size:[102400 TO 1048576]\", \"label\": \"medium\",\"group\":\"foo\"}," + "{\"query\": \"content.size:[1048576 TO 16777216]\", \"label\": \"large\"}]" + "}";
    String expectedResponse = "{\"responseHeader\":{\"status\":0,\"QTime\":9},\"_original_parameters_\":\"org.apache.solr.common.params.DefaultSolrParams:{params(df=TEXT&alternativeDic=DEFAULT_DICTIONARY&fl=DBID,score&start=0&fq={!afts}AUTHORITY_FILTER_FROM_JSON&fq={!afts}TENANT_FILTER_FROM_JSON&rows=1000&locale=en_US&wt=json),defaults(carrot.url=id&spellcheck.collateExtendedResults=true&carrot.produceSummary=true&spellcheck.maxCollations=3&spellcheck.maxCollationTries=5&spellcheck.alternativeTermCount=2&spellcheck.extendedResults=false&defType=afts&spellcheck.maxResultsForSuggest=5&spellcheck=false&carrot.outputSubClusters=false&spellcheck.count=5&carrot.title=mltext@m___t@{http://www.alfresco.org/model/content/1.0}title&carrot.snippet=content@s___t@{http://www.alfresco.org/model/content/1.0}content&spellcheck.collate=true)}\",\"_field_mappings_\":{},\"_date_mappings_\":{},\"_range_mappings_\":{},\"_pivot_mappings_\":{},\"_interval_mappings_\":{},\"_stats_field_mappings_\":{},\"_stats_facet_mappings_\":{},\"_facet_function_mappings_\":{},\"response\":{\"numFound\":6,\"start\":0,\"maxScore\":0.7849362,\"docs\":[{\"DBID\":565,\"score\":0.7849362},{\"DBID\":566,\"score\":0.7849362},{\"DBID\":521,\"score\":0.3540957},{\"DBID\":514,\"score\":0.33025497},{\"DBID\":420,\"score\":0.32440513},{\"DBID\":415,\"score\":0.2780319}]}," + "\"spellcheck\":{\"searchInsteadFor\":\"alfresco\"}," + "\"facet_counts\":{\"facet_queries\": {\"small\": 52,\"large\": 0,\"medium\": 0}}," + "\"processedDenies\":true, \"lastIndexedTx\":34}";
    ResultSet results = mockResultset(expectedResponse);
    SearchQuery searchQuery = helper.extractFromJson(jsonQuery);
    SearchRequestContext searchRequest = SearchRequestContext.from(searchQuery);
    SearchContext searchContext = mapper.toSearchContext((SolrJSONResultSet) results, searchRequest, searchQuery, 0);
    assertEquals(34l, searchContext.getConsistency().getlastTxId());
    assertEquals(null, searchContext.getFacetQueries());
    assertEquals(2, searchContext.getFacets().size());
    assertEquals(2, searchContext.getFacets().get(0).getBuckets().size());
    assertEquals("small", searchContext.getFacets().get(0).getBuckets().get(0).getLabel());
    assertEquals("content.size:[o TO 102400]", searchContext.getFacets().get(0).getBuckets().get(0).getFilterQuery());
    assertFalse(searchContext.getFacets().get(0).getBuckets().get(0).getMetrics().isEmpty());
    Metric[] metrics = searchContext.getFacets().get(0).getBuckets().get(0).getMetrics().toArray(new Metric[searchContext.getFacets().get(0).getBuckets().get(0).getMetrics().size()]);
    assertEquals(METRIC_TYPE.count, metrics[0].getType());
    assertEquals("{count=52}", metrics[0].getValue().toString());
}
Also used : SearchQuery(org.alfresco.rest.api.search.model.SearchQuery) ResultSet(org.alfresco.service.cmr.search.ResultSet) EmptyResultSet(org.alfresco.repo.search.EmptyResultSet) SolrJSONResultSet(org.alfresco.repo.search.impl.lucene.SolrJSONResultSet) SearchContext(org.alfresco.rest.api.search.context.SearchContext) PercentileMetric(org.alfresco.repo.search.impl.solr.facet.facetsresponse.PercentileMetric) Metric(org.alfresco.repo.search.impl.solr.facet.facetsresponse.Metric) SimpleMetric(org.alfresco.repo.search.impl.solr.facet.facetsresponse.SimpleMetric) ListMetric(org.alfresco.repo.search.impl.solr.facet.facetsresponse.ListMetric) Matchers.anyString(org.mockito.Matchers.anyString) SearchRequestContext(org.alfresco.rest.api.search.context.SearchRequestContext) Test(org.junit.Test)

Aggregations

SearchRequestContext (org.alfresco.rest.api.search.context.SearchRequestContext)19 Test (org.junit.Test)16 SearchQuery (org.alfresco.rest.api.search.model.SearchQuery)13 ResultSet (org.alfresco.service.cmr.search.ResultSet)12 EmptyResultSet (org.alfresco.repo.search.EmptyResultSet)11 SolrJSONResultSet (org.alfresco.repo.search.impl.lucene.SolrJSONResultSet)11 SearchParameters (org.alfresco.service.cmr.search.SearchParameters)11 SearchContext (org.alfresco.rest.api.search.context.SearchContext)10 Metric (org.alfresco.repo.search.impl.solr.facet.facetsresponse.Metric)9 SimpleMetric (org.alfresco.repo.search.impl.solr.facet.facetsresponse.SimpleMetric)9 Matchers.anyString (org.mockito.Matchers.anyString)9 ListMetric (org.alfresco.repo.search.impl.solr.facet.facetsresponse.ListMetric)8 PercentileMetric (org.alfresco.repo.search.impl.solr.facet.facetsresponse.PercentileMetric)8 Node (org.alfresco.rest.api.model.Node)8 ArrayList (java.util.ArrayList)7 Arrays (java.util.Arrays)6 List (java.util.List)6 Map (java.util.Map)6 Set (java.util.Set)6 Collectors (java.util.stream.Collectors)6