Changeset 29217
- Timestamp:
- 2014-08-19T19:40:31+12:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrQueryWrapper.java
r29209 r29217 78 78 SolrServer solr_core = null; 79 79 80 String collection_core_name_prefix = null; 81 80 82 public SolrQueryWrapper() 81 83 { … … 93 95 this.solr_core = solr_core; 94 96 } 97 98 public void setCollectionCoreNamePrefix(String colCoreNamePrefix) { 99 this.collection_core_name_prefix = colCoreNamePrefix; 100 } 101 95 102 // make sure its not null. 96 103 public void setSortField(String sort_field) { … … 158 165 Iterator<SolrCore> coreIterator = solrCores.iterator(); 159 166 160 // Just use the first core, since the term frequency of any term is the same regardless of core 161 if(coreIterator.hasNext()) { 167 // Just use the first core that matches the collection name, since the term 168 // frequency of any term is the same regardless of whether its didx or sidx core 169 boolean foundCore = false; 170 while(coreIterator.hasNext() && !foundCore) { 162 171 SolrCore solrCore = coreIterator.next(); 163 172 if(!solrCore.getName().startsWith(this.collection_core_name_prefix)) { 173 //logger.error("### Skipping core not of this collection: " + solrCore.getName()); 174 continue; 175 } 176 177 //logger.error("### Found core " + solrCore.getName() + " of this collection " + this.collection_core_name_prefix); 178 foundCore = true; 164 179 165 180 LocalSolrQueryRequest solrQueryRequest = new LocalSolrQueryRequest(solrCore, solrQuery);
Note:
See TracChangeset
for help on using the changeset viewer.