Project

General

Profile

« Previous | Next » 

Revision 7685

Added by Jing Tao over 11 years ago

Only after reloading the core, the query result can reflect the change made in metacat-index module.

View differences:

src/edu/ucsb/nceas/metacat/index/MetacatSolrIndex.java
186 186
     * @throws ClassNotFoundException 
187 187
     * @throws SQLException 
188 188
     * @throws PropertyNotFoundException 
189
     * @throws SAXException 
190
     * @throws ParserConfigurationException 
189 191
     */
190
    public InputStream query(String query, Set<Subject>authorizedSubjects) throws SolrServerException, IOException, PropertyNotFoundException, SQLException, ClassNotFoundException {
192
    public InputStream query(String query, Set<Subject>authorizedSubjects) throws SolrServerException, IOException, PropertyNotFoundException, SQLException, ClassNotFoundException, ParserConfigurationException, SAXException {
191 193
        if(authorizedSubjects == null || authorizedSubjects.isEmpty()) {
192 194
            throw new SolrServerException("MetacatSolrIndex.query - There is no any authorized subjects(even the public user) in this query session.");
193 195
        }
......
205 207
     * @throws ClassNotFoundException 
206 208
     * @throws SQLException 
207 209
     * @throws PropertyNotFoundException 
210
     * @throws SAXException 
211
     * @throws ParserConfigurationException 
208 212
     */
209
    private InputStream queryEmbedded(String query, Set<Subject>subjects) throws SolrServerException, IOException, PropertyNotFoundException, SQLException, ClassNotFoundException {
213
    private InputStream queryEmbedded(String query, Set<Subject>subjects) throws SolrServerException, IOException, PropertyNotFoundException, SQLException, ClassNotFoundException, ParserConfigurationException, SAXException {
210 214
        InputStream inputStream = null;
211 215
        SolrParams solrParams = SolrRequestParsers.parseQueryString(query);
212 216
        solrParams = appendAccessFilterParams(solrParams, subjects);
213 217
        String wt = solrParams.get(WT);
214 218
        
219
        //reload the core before query. Only after reloading the core, the query result can reflect the change made in metacat-index module.
220
        coreContainer.reload(collectionName);
221
        
215 222
        // handle normal and skin-based queries
216 223
        if (wt == null ||supportedWriterTypes.contains(wt)) {
217 224
        	// just handle as normal solr query

Also available in: Unified diff