Lines 42-47
Link Here
|
42 |
package org.netbeans.modules.maven.indexer; |
42 |
package org.netbeans.modules.maven.indexer; |
43 |
|
43 |
|
44 |
import java.io.FileNotFoundException; |
44 |
import java.io.FileNotFoundException; |
|
|
45 |
import org.apache.maven.index.expr.StringSearchExpression; |
45 |
import org.codehaus.plexus.util.FileUtils; |
46 |
import org.codehaus.plexus.util.FileUtils; |
46 |
import java.util.Map; |
47 |
import java.util.Map; |
47 |
import org.apache.lucene.document.Document; |
48 |
import org.apache.lucene.document.Document; |
Lines 98-103
Link Here
|
98 |
import org.apache.maven.index.GroupedSearchRequest; |
99 |
import org.apache.maven.index.GroupedSearchRequest; |
99 |
import org.apache.maven.index.GroupedSearchResponse; |
100 |
import org.apache.maven.index.GroupedSearchResponse; |
100 |
import org.apache.maven.index.IndexerFieldVersion; |
101 |
import org.apache.maven.index.IndexerFieldVersion; |
|
|
102 |
import org.apache.maven.index.MAVEN; |
101 |
import org.apache.maven.index.NexusIndexer; |
103 |
import org.apache.maven.index.NexusIndexer; |
102 |
import org.apache.maven.index.context.IndexingContext; |
104 |
import org.apache.maven.index.context.IndexingContext; |
103 |
import org.apache.maven.index.creator.AbstractIndexCreator; |
105 |
import org.apache.maven.index.creator.AbstractIndexCreator; |
Lines 883-889
Link Here
|
883 |
public @Override Void run() throws Exception { |
885 |
public @Override Void run() throws Exception { |
884 |
loadIndexingContext(repo); |
886 |
loadIndexingContext(repo); |
885 |
String clsname = className.replace(".", "/"); |
887 |
String clsname = className.replace(".", "/"); |
886 |
FlatSearchRequest fsr = new FlatSearchRequest(setBooleanRewrite(indexer.constructQuery(ArtifactInfo.NAMES, clsname.toLowerCase())), |
888 |
FlatSearchRequest fsr = new FlatSearchRequest(setBooleanRewrite( |
|
|
889 |
indexer.constructQuery(MAVEN.CLASSNAMES, new StringSearchExpression(clsname.toLowerCase()))), |
887 |
ArtifactInfo.VERSION_COMPARATOR); |
890 |
ArtifactInfo.VERSION_COMPARATOR); |
888 |
fsr.setAiCount(MAX_RESULT_COUNT); |
891 |
fsr.setAiCount(MAX_RESULT_COUNT); |
889 |
FlatSearchResponse response = repeatedFlatSearch(fsr, getContexts(new RepositoryInfo[]{repo}), false); |
892 |
FlatSearchResponse response = repeatedFlatSearch(fsr, getContexts(new RepositoryInfo[]{repo}), false); |
Lines 941-947
Link Here
|
941 |
public @Override Void run() throws Exception { |
944 |
public @Override Void run() throws Exception { |
942 |
loadIndexingContext(repo); |
945 |
loadIndexingContext(repo); |
943 |
BooleanQuery bq = new BooleanQuery(); |
946 |
BooleanQuery bq = new BooleanQuery(); |
944 |
bq.add(new BooleanClause((setBooleanRewrite(indexer.constructQuery(ArtifactInfo.SHA1, sha1))), BooleanClause.Occur.SHOULD)); |
947 |
bq.add(new BooleanClause((setBooleanRewrite(indexer.constructQuery(MAVEN.SHA1, new StringSearchExpression(sha1)))), BooleanClause.Occur.SHOULD)); |
945 |
FlatSearchRequest fsr = new FlatSearchRequest(bq, ArtifactInfo.VERSION_COMPARATOR); |
948 |
FlatSearchRequest fsr = new FlatSearchRequest(bq, ArtifactInfo.VERSION_COMPARATOR); |
946 |
fsr.setAiCount(MAX_RESULT_COUNT); |
949 |
fsr.setAiCount(MAX_RESULT_COUNT); |
947 |
FlatSearchResponse response = repeatedFlatSearch(fsr, getContexts(new RepositoryInfo[]{repo}), false); |
950 |
FlatSearchResponse response = repeatedFlatSearch(fsr, getContexts(new RepositoryInfo[]{repo}), false); |
Lines 1101-1109
Link Here
|
1101 |
Query q; |
1104 |
Query q; |
1102 |
if (ArtifactInfo.NAMES.equals(fieldName)) { |
1105 |
if (ArtifactInfo.NAMES.equals(fieldName)) { |
1103 |
String clsname = field.getValue().replace(".", "/"); //NOI18N |
1106 |
String clsname = field.getValue().replace(".", "/"); //NOI18N |
1104 |
q = indexer.constructQuery(ArtifactInfo.NAMES, clsname.toLowerCase()); |
1107 |
q = indexer.constructQuery(MAVEN.CLASSNAMES, new StringSearchExpression(clsname.toLowerCase())); |
1105 |
} else if (ArtifactInfo.ARTIFACT_ID.equals(fieldName)) { |
1108 |
} else if (ArtifactInfo.ARTIFACT_ID.equals(fieldName)) { |
1106 |
q = indexer.constructQuery(fieldName, field.getValue()); |
1109 |
q = indexer.constructQuery(MAVEN.ARTIFACT_ID, new StringSearchExpression(field.getValue())); |
1107 |
} else { |
1110 |
} else { |
1108 |
if (field.getMatch() == QueryField.MATCH_EXACT) { |
1111 |
if (field.getMatch() == QueryField.MATCH_EXACT) { |
1109 |
q = new TermQuery(new Term(fieldName, field.getValue())); |
1112 |
q = new TermQuery(new Term(fieldName, field.getValue())); |