1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.maven.index;
20
21 import java.io.IOException;
22 import java.util.Collection;
23 import java.util.Comparator;
24 import java.util.Set;
25
26 import org.apache.lucene.search.Query;
27 import org.apache.maven.index.context.IndexingContext;
28
29 /**
30 * A search engine used to perform searches trough repository indexes.
31 *
32 * @author Eugene Kuleshov
33 * @author Jason van Zyl
34 * @author Tamas Cservenak
35 */
36 public interface SearchEngine {
37 @Deprecated
38 Set<ArtifactInfo> searchFlat(
39 Comparator<ArtifactInfo> artifactInfoComparator, IndexingContext indexingContext, Query query)
40 throws IOException;
41
42 @Deprecated
43 Set<ArtifactInfo> searchFlat(
44 Comparator<ArtifactInfo> artifactInfoComparator, Collection<IndexingContext> indexingContexts, Query query)
45 throws IOException;
46
47 /**
48 * Do the search only on searchable contexts
49 */
50 FlatSearchResponse searchFlatPaged(FlatSearchRequest request, Collection<IndexingContext> indexingContexts)
51 throws IOException;
52
53 /**
54 * Do the search only on searchable contexts
55 */
56 IteratorSearchResponse searchIteratorPaged(
57 IteratorSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException;
58
59 /**
60 * Do the search only on searchable contexts
61 */
62 GroupedSearchResponse searchGrouped(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts)
63 throws IOException;
64
65 /**
66 * Do the search in all contexts, no matter if the context is searchable or not
67 */
68 FlatSearchResponse forceSearchFlatPaged(FlatSearchRequest request, Collection<IndexingContext> indexingContexts)
69 throws IOException;
70
71 /**
72 * Do the search in all contexts, no matter if the context is searchable or not
73 */
74 IteratorSearchResponse forceSearchIteratorPaged(
75 IteratorSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException;
76
77 /**
78 * Do the search in all contexts, no matter if the context is searchable or not
79 */
80 GroupedSearchResponse forceSearchGrouped(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts)
81 throws IOException;
82 }