diff --git a/deploy/adsabs/server/solr/collection1/conf/solrconfig.xml b/deploy/adsabs/server/solr/collection1/conf/solrconfig.xml index fbbe0838a..aa8191ee8 100644 --- a/deploy/adsabs/server/solr/collection1/conf/solrconfig.xml +++ b/deploy/adsabs/server/solr/collection1/conf/solrconfig.xml @@ -145,6 +145,7 @@ You can disable the cache/and cache-warming/ by setting the values to zero --> + true @@ -796,17 +798,21 @@ + + bibcode,recid diff --git a/montysolr/src/main/java/org/apache/lucene/queryparser/flexible/aqp/builders/AqpAdsabsSubQueryProvider.java b/montysolr/src/main/java/org/apache/lucene/queryparser/flexible/aqp/builders/AqpAdsabsSubQueryProvider.java index 5f680b6e0..fce4f52b4 100644 --- a/montysolr/src/main/java/org/apache/lucene/queryparser/flexible/aqp/builders/AqpAdsabsSubQueryProvider.java +++ b/montysolr/src/main/java/org/apache/lucene/queryparser/flexible/aqp/builders/AqpAdsabsSubQueryProvider.java @@ -37,14 +37,11 @@ import org.apache.solr.schema.IndexSchema; import org.apache.solr.schema.SchemaField; import org.apache.solr.search.*; -import org.apache.lucene.search.join.JoinUtil; -import org.apache.lucene.search.join.ScoreMode; import org.apache.solr.servlet.SolrRequestParsers; import org.apache.solr.uninverting.UninvertingReader; import java.io.IOException; import java.util.*; -import java.util.stream.Collectors; /** @@ -626,9 +623,15 @@ public Query parse(FunctionQParser fp) throws SyntaxError { public Query parse(FunctionQParser fp) throws SyntaxError { Query innerQuery = fp.parseNestedQuery(); + CitationCache citationCache = (CitationCache) fp.getReq().getSearcher().getCache("citations-cache"); + if (citationCache == null) { + // TODO: Perform citation query without the cache??? + return innerQuery; + } + @SuppressWarnings("unchecked") SolrCacheWrapper> citationsWrapper = new SolrCacheWrapper.CitationsCache( - (CitationCache) fp.getReq().getSearcher().getCache("citations-cache")); + citationCache); return new SecondOrderQuery(innerQuery, new SecondOrderCollectorCitedBy(citationsWrapper), false); @@ -1075,7 +1078,7 @@ public Query parse(FunctionQParser fp) throws SyntaxError { final SolrQueryRequest req = fp.getReq(); @SuppressWarnings("rawtypes") final CitationCache cache = (CitationCache) req.getSearcher().getCache("citations-cache"); - if (!cache.isWarmingOrWarmed()) { + if (cache != null && !cache.isWarmingOrWarmed()) { if (cache.size() > 0) { return new MatchNoDocsQuery(); // we only allow it once (solr warms caches after first searcher was opened) }