Hello, I am trying to make simple readings over Lucene indexes by using SolrJ. I have been able to access the sample index available in the SolrJ download, but I get an exception when trying to make the reading.
04-feb-2010 17:05:05 org.apache.solr.common.SolrException log
GRAVE: org.apache.solr.common.SolrException: undefined field null
My index only has one document with a single field, called “nombre”
I have specified this in the schema.xml and the route in the slconfig.xml
Java code
System.setProperty( "solr.solr.home", "C:\\solr" );
// CREATING THE SERVER
CoreContainer.Initializer initializer = new CoreContainer.Initializer();
CoreContainer coreContainer = null;
SolrServer embServer = null;
coreContainer = initializer.initialize();
embServer = new EmbeddedSolrServer(coreContainer, "");
// READING
SolrQuery query = new SolrQuery();
String q = "*";
query.setQuery(q);
QueryResponse rsp = null;
/// HERE I GET THE EXCEPTION ///
rsp = embServer.query( query );
/// HERE I GET THE EXCEPTION ///
// GETTING THE NUMBER OF ITEMS
SolrDocumentList docs = rsp.getResults();
System.out.println( docs.size() );
Any ideas? Can you give me a solution? Is it a common mistake? Thank you very much in advance.