All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.cq.social.srp.internal.SocialIndexer Maven / Gradle / Ivy

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * __________________
 *
 *  Copyright 2012 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/
package com.adobe.cq.social.srp.internal;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import org.apache.sling.api.resource.PersistenceException;

import aQute.bnd.annotation.ProviderType;

import com.adobe.cq.social.srp.FacetRangeField;
import com.adobe.cq.social.srp.FacetSearchResult;
import com.adobe.cq.social.srp.SearchSortField;
import com.adobe.cq.social.srp.SocialResourceSearchResult;
import com.adobe.cq.social.srp.config.SocialResourceConfiguration;

/**
 * Interface that should be implemented by anybody who wants the social ugc data to be indexed for better efficient
 * searching EG: Solr, ElasticSearch, etc
 */
@ProviderType
public interface SocialIndexer {
    /**
     * To allow sharding on tenant id. Uses reportSuite from configuration
     */
    public static final String REPORT_SUITE = "report_suite";

    public void setupClient(final SocialResourceConfiguration genericConfiguration) throws IOException;

    public void addToIndex(final Map data) throws IOException;

    public void delete(String key);

    public FacetResults facetedSearch(final String queryToAs, final List facetFields,
        final List pivotFields, final String rows, final String mincount, final boolean isPivot,
        final SocialDatabase database) throws PersistenceException;

    public List> getMLTResults(final String query, final String statusFilter,
        final String resourceTypeFilter, final String componentFilter, final List mltField,
        final int maxResults, final int minTermFreq, final int minDocFreq, final SocialDatabase database)
        throws IOException;

    public SocialResourceSearchResult> find(String component, String solrQueryString,
        List sortFields, int offset, int limit, final SocialDatabase database,
        Map signals) throws IOException;

    public FacetSearchResult findFacets(List countFields, List rangeFields,
        String resourceTypeFilter, String componentFilter, int count, boolean visibleOnly, boolean includeChildren)
        throws IOException;

    SocialResourceSearchResult> findFacets(final List inPath,
        final List notInPath, final List fieldNames, final List facetRanges,
        final String scoredQueryString, final int maxFacetCount, final List sortFields,
        final int offset, final int pageSize, final SocialDatabase database) throws IOException;

    public long countChildren(String keyValue, String baseType, boolean visibleOnly) throws PersistenceException;

    public List> nonFacetedSearch(String solrQueryString, final SocialDatabase database)
        throws PersistenceException;

    public void setSolrConfig(final int solrZKTimeout, final int commitWithin, AbstractSchemaMapper mapper);

    /**
     * Simply provide access to the same method in org.apache.solr.client.solrj.util.ClientUtils
     * @param query String query
     * @return String
     */
    public String escapeQueryChars(final String query);

    /**
     * Returns a list of 'id' matching the given key and its children
     * @param key String
     * @param limit int
     * @param offset  int
     * @return List
     * @throws IOException IOException
     */
    public List readForDelete(String key, int offset, int limit) throws IOException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy