Hi,
I am building off the maven-indexer examples and trying to find
artifacts with a certain Bundle-SymbolicName. I have configured the
OSGi indexer before downloading the index
List<IndexCreator> indexers = new ArrayList<>();
indexers.add(plexusContainer.lookup(IndexCreator.class, "min"));
indexers.add(plexusContainer.lookup(IndexCreator.class,
"jarContent"));
indexers.add(plexusContainer.lookup(IndexCreator.class, "maven-
plugin"));
indexers.add(plexusContainer.lookup(IndexCreator.class, "osgi-
metadatas"));
and am firing off a query for the BSN field
BooleanQuery q = new BooleanQuery();
q.add(indexer.constructQuery(OSGI.SYMBOLIC_NAME, new
SourcedSearchExpression(bsn)), Occur.MUST);
When running the search I get a logged warning
[WARNING] EXACT type of querying for non-keyword (but stored) field
urn:osgi#exportPackage (with 1 registered index fields) was tried.
Please review your code, or indexCreator involved, since this type of
querying of this field is currently unsupported.
and then a NPE ( see end of mail ).
What am I doing wrong? My understanding is that these fields should be
available for querying. Is there another way of querying for this data?
Thanks,
Robert
(Please keep me in CC, I am not subscribed to this mailing list)
Exception in thread "main" java.lang.NullPointerException
at
org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:363)
at
org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:592)
at
org.apache.lucene.search.Searcher.createNormalizedWeight(Searcher.java:
167)
at
org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSear
cher.java:664)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:383)
at
org.apache.maven.index.DefaultSearchEngine.doSearchWithCeiling(DefaultS
earchEngine.java:336)
at
org.apache.maven.index.DefaultSearchEngine.searchIteratorPaged(DefaultS
earchEngine.java:280)
at
org.apache.maven.index.DefaultSearchEngine.forceSearchIteratorPaged(Def
aultSearchEngine.java:264)
at
org.apache.maven.index.DefaultIndexer.searchIterator(DefaultIndexer.jav
a:157)
at
nu.muntea.ca.maven.impl.OsgiArtifactLocator.searchForSlingBundles(OsgiA
rtifactLocator.java:137)
at
nu.muntea.ca.maven.impl.OsgiArtifactLocator.run(OsgiArtifactLocator.jav
a:118)
at
nu.muntea.ca.maven.impl.OsgiArtifactLocator.main(OsgiArtifactLocator.ja
va:47)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]