updates to individual solr field options
This commit is contained in:
parent
03cc412c39
commit
9cee22ace9
1 changed files with 0 additions and 84 deletions
|
@ -3,13 +3,6 @@ package edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import java.util.Comparator;
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
=======
|
||||
>>>>>>> 15e0fc0... updates for individuals via solr field options
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -25,24 +18,9 @@ import org.apache.solr.common.SolrDocument;
|
|||
import org.apache.solr.common.SolrDocumentList;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;
|
||||
=======
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||
=======
|
||||
>>>>>>> 15e0fc0... updates for individuals via solr field options
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;
|
||||
<<<<<<< HEAD
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.DefaultObjectPropertyFormGenerator;
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
=======
|
||||
>>>>>>> 15e0fc0... updates for individuals via solr field options
|
||||
import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup;
|
||||
|
||||
|
@ -53,24 +31,9 @@ import edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup;
|
|||
public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions implements FieldOptions {
|
||||
private Log log = LogFactory.getLog(IndividualsViaSolrQueryOptions.class);
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
private ServletContext servletContext;
|
||||
public IndividualsViaSolrQueryOptions(ServletContext context, String ... vclassURIs) throws Exception {
|
||||
super(vclassURIs);
|
||||
=======
|
||||
public static final String LEFT_BLANK = "";
|
||||
private List<String> vclassURIs;
|
||||
private String defaultOptionLabel;
|
||||
private ServletContext servletContext;
|
||||
public IndividualsViaSolrQueryOptions(ServletContext context, String ... vclassURIs) throws Exception {
|
||||
super();
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
=======
|
||||
private ServletContext servletContext;
|
||||
public IndividualsViaSolrQueryOptions(ServletContext context, String ... vclassURIs) throws Exception {
|
||||
super(vclassURIs);
|
||||
>>>>>>> 15e0fc0... updates for individuals via solr field options
|
||||
this.servletContext = context;
|
||||
}
|
||||
|
||||
|
@ -87,15 +50,10 @@ public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions
|
|||
}else{
|
||||
query.setQuery( VitroSearchTermNames.MOST_SPECIFIC_TYPE_URIS + ":" + vclassURI);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 15e0fc0... updates for individuals via solr field options
|
||||
query.setStart(0)
|
||||
.setRows(1000);
|
||||
query.setFields(VitroSearchTermNames.URI); // fields to retrieve
|
||||
|
||||
<<<<<<< HEAD
|
||||
QueryResponse rsp = solrServer.query(query);
|
||||
SolrDocumentList docs = rsp.getResults();
|
||||
long found = docs.getNumFound();
|
||||
|
@ -114,40 +72,6 @@ public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions
|
|||
catch(Exception ex) {
|
||||
log.error("An error occurred retrieving the individual solr query resutls", ex);
|
||||
}
|
||||
=======
|
||||
query.setRows(0);
|
||||
QueryResponse rsp = solrServer.query(query);
|
||||
SolrDocumentList docs = rsp.getResults();
|
||||
long found = docs.getNumFound();
|
||||
for (SolrDocument doc : docs) {
|
||||
String uri = doc.get(VitroSearchTermNames.URI).toString();
|
||||
Individual individual = wDaoFact.getIndividualDao().getIndividualByURI(uri);
|
||||
if (individual == null) {
|
||||
log.debug("No individual for search document with uri = " + uri);
|
||||
} else {
|
||||
individualMap.put(individual.getURI(), individual);
|
||||
log.debug("Adding individual " + uri + " to individual list");
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
=======
|
||||
QueryResponse rsp = solrServer.query(query);
|
||||
SolrDocumentList docs = rsp.getResults();
|
||||
long found = docs.getNumFound();
|
||||
if(found > 0) {
|
||||
for (SolrDocument doc : docs) {
|
||||
try {
|
||||
String uri = doc.get(VitroSearchTermNames.URI).toString();
|
||||
Individual individual = wDaoFact.getIndividualDao().getIndividualByURI(uri);
|
||||
if (individual == null) {
|
||||
log.debug("No individual for search document with uri = " + uri);
|
||||
} else {
|
||||
individualMap.put(individual.getURI(), individual);
|
||||
log.debug("Adding individual " + uri + " to individual list");
|
||||
}
|
||||
}
|
||||
catch(Exception ex) {
|
||||
log.error("An error occurred retrieving the individual solr query resutls", ex);
|
||||
}
|
||||
>>>>>>> 15e0fc0... updates for individuals via solr field options
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,15 +89,7 @@ public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions
|
|||
|
||||
Map<String, Individual> individualMap = new HashMap<String, Individual>();
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
for( String vclassURI : vclassURIs){
|
||||
=======
|
||||
for( String vclassURI : this.vclassURIs){
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
=======
|
||||
for( String vclassURI : vclassURIs){
|
||||
>>>>>>> 15e0fc0... updates for individuals via solr field options
|
||||
individualMap.putAll( getIndividualsForClass( vclassURI, wDaoFact) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue