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