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

com.alogient.cameleon.sdk.search.SearchService Maven / Gradle / Ivy

The newest version!
package com.alogient.cameleon.sdk.search;

import com.alogient.cameleon.sdk.content.model.AbstractCameleonModel;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.common.SolrDocument;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Set;

@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public interface SearchService {
    public static final String SEARCH_ID = "id";
    public static final String SEARCH_NAV_ID = "navId";
    public static final String SEARCH_PAGE_ID = "pageId";
    public static final String SEARCH_CULTURE_CODE = "cultureCode";
    public static final String SEARCH_PAGE_NAME = "pageName";
    public static final String SEARCH_TEMPLATE_NAME = "templateName";


    /**
     * @return the indexed URLS from solr server
     */
    Set getIndexedUrls();

    /**
     * Remove the index associated to a specific URL
     * @param url the url
     */
    void removeIndex(String url);

    /**
     * Index a Camaleon model
     * @param url the url used as an index
     * @param model the model to index
     */
    void indexCameleonModel(String url, AbstractCameleonModel model);

    /**
     * Index a binary file (docx, pdf, etc.) Tika is used to create the metadata
     * @param path the path where the file is located
     * @param fileName the name of the  binary file to index
     * @param isRemote true if the document is remote, false otherwise
     */
    void indexBinaryDocument(String path, String fileName, boolean isRemote);

    /**
     * @return true if the SOLR server will be accessible in read only mode, false otherwise
     */
    boolean isReadOnly();

    /**
     * @return true if solr is initialized, false otherwise
     */
    boolean isInitialized();

    /**
     * Do a quick search
     * @param query the query used for the search
     * @return a list of found documents
     */
    List doSearch(SolrQuery query);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy