Merge from 1.3 maint
This commit is contained in:
parent
1b260b2e67
commit
7abaa39fa3
5 changed files with 86 additions and 26 deletions
|
@ -319,14 +319,15 @@ public class IndividualListController extends FreemarkerHttpServlet {
|
|||
}
|
||||
|
||||
SolrQuery query = new SolrQuery(queryText);
|
||||
|
||||
query.setStart( page > 0 ? pageSize * page + 1 : 0 )
|
||||
.setRows( pageSize );
|
||||
|
||||
//page count starts at 1, row count starts at 0
|
||||
int startRow = (page-1) * pageSize ;
|
||||
query.setStart( startRow ).setRows( pageSize );
|
||||
|
||||
// Need a single-valued field for sorting
|
||||
query.setSortField(VitroSearchTermNames.NAME_LOWERCASE_SINGLE_VALUED, SolrQuery.ORDER.asc);
|
||||
|
||||
log.debug("Query text is " + queryText);
|
||||
log.debug("Query is " + query.toString());
|
||||
return query;
|
||||
|
||||
} catch (Exception ex){
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package edu.cornell.mannlib.vitro.webapp.search.indexing;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.hp.hpl.jena.rdf.model.Statement;
|
||||
import com.hp.hpl.jena.vocabulary.RDF;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
|
||||
|
||||
/**
|
||||
* Adds URIs to index for type statement changes on individuals.
|
||||
*/
|
||||
public class AdditionalURIsForTypeStatements implements StatementToURIsToUpdate {
|
||||
|
||||
@Override
|
||||
public List<String> findAdditionalURIsToIndex(Statement stmt) {
|
||||
if( stmt != null && RDF.type.getURI().equals( stmt.getPredicate().getURI() )){
|
||||
return Collections.singletonList( stmt.getSubject().getURI() );
|
||||
}else{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -35,6 +35,7 @@ import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
|
|||
import edu.cornell.mannlib.vitro.webapp.search.indexing.AdditionalURIsForContextNodes;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.indexing.AdditionalURIsForDataProperties;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.indexing.AdditionalURIsForObjectProperties;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.indexing.AdditionalURIsForTypeStatements;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.indexing.IndexBuilder;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.indexing.SearchReindexingListener;
|
||||
import edu.cornell.mannlib.vitro.webapp.servlet.setup.AbortStartup;
|
||||
|
@ -112,6 +113,7 @@ public class SolrSetup implements javax.servlet.ServletContextListener{
|
|||
uriFinders.add( new AdditionalURIsForDataProperties() );
|
||||
uriFinders.add( new AdditionalURIsForObjectProperties(jenaOntModel) );
|
||||
uriFinders.add( new AdditionalURIsForContextNodes(jenaOntModel) );
|
||||
uriFinders.add( new AdditionalURIsForTypeStatements() );
|
||||
|
||||
IndexBuilder builder = new IndexBuilder( solrIndexer, wadf, uriFinders );
|
||||
// to the servlet context so we can access it later in the webapp.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue