001/*
002 *  Copyright 2026 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.web.indexing.solr;
017
018import org.ametys.cms.indexing.solr.AdditionalDataIndexer;
019import org.ametys.cms.search.query.Query;
020
021/**
022 * Index additional items on already indexed object (content, resources...) on web context
023 */
024public interface AdditionalWebDataIndexer extends AdditionalDataIndexer
025{
026    /**
027     * The solr query that returns the documents to delete when unindexing all items of the given type in the given site
028     * @param type The type of the items to unindex
029     * @param siteName The site name of the items to unindex
030     * @return The solr query that returns the documents to delete. Can be null
031     * @throws Exception If an error occurs while building the queries
032     */
033    Query getUnindexSiteQuery(String type, String siteName) throws Exception;
034
035    /**
036     * The solr query that returns the documents to delete when unindexing all items of the given type in the given site
037     * @param type The type of the items to unindex
038     * @param siteName The site name of the items to unindex
039     * @param sitemapName The sitemap name of the items to unindex
040     * @return The solr query that returns the documents to delete. Can be null
041     * @throws Exception If an error occurs while building the queries
042     */
043    Query getUnindexSitemapQuery(String type, String siteName, String sitemapName) throws Exception;
044}