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.ArrayList;
|
||||||
import java.util.Collections;
|
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.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -25,24 +18,9 @@ import org.apache.solr.common.SolrDocument;
|
||||||
import org.apache.solr.common.SolrDocumentList;
|
import org.apache.solr.common.SolrDocumentList;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
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.VitroVocabulary;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;
|
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.VitroSearchTermNames;
|
||||||
import edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup;
|
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 {
|
public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions implements FieldOptions {
|
||||||
private Log log = LogFactory.getLog(IndividualsViaSolrQueryOptions.class);
|
private Log log = LogFactory.getLog(IndividualsViaSolrQueryOptions.class);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private ServletContext servletContext;
|
private ServletContext servletContext;
|
||||||
public IndividualsViaSolrQueryOptions(ServletContext context, String ... vclassURIs) throws Exception {
|
public IndividualsViaSolrQueryOptions(ServletContext context, String ... vclassURIs) throws Exception {
|
||||||
super(vclassURIs);
|
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;
|
this.servletContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,15 +50,10 @@ public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions
|
||||||
}else{
|
}else{
|
||||||
query.setQuery( VitroSearchTermNames.MOST_SPECIFIC_TYPE_URIS + ":" + vclassURI);
|
query.setQuery( VitroSearchTermNames.MOST_SPECIFIC_TYPE_URIS + ":" + vclassURI);
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
>>>>>>> 15e0fc0... updates for individuals via solr field options
|
|
||||||
query.setStart(0)
|
query.setStart(0)
|
||||||
.setRows(1000);
|
.setRows(1000);
|
||||||
query.setFields(VitroSearchTermNames.URI); // fields to retrieve
|
query.setFields(VitroSearchTermNames.URI); // fields to retrieve
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
QueryResponse rsp = solrServer.query(query);
|
QueryResponse rsp = solrServer.query(query);
|
||||||
SolrDocumentList docs = rsp.getResults();
|
SolrDocumentList docs = rsp.getResults();
|
||||||
long found = docs.getNumFound();
|
long found = docs.getNumFound();
|
||||||
|
@ -114,40 +72,6 @@ public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions
|
||||||
catch(Exception ex) {
|
catch(Exception ex) {
|
||||||
log.error("An error occurred retrieving the individual solr query resutls", 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>();
|
Map<String, Individual> individualMap = new HashMap<String, Individual>();
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
for( String vclassURI : vclassURIs){
|
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) );
|
individualMap.putAll( getIndividualsForClass( vclassURI, wDaoFact) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue