Hi, 

I am new in Solr. I am using Solr version 1.3 

I would like to index XML files using SolrJ API. I have gone through solr 
mailing list's emails and have been able to index XML files. But when I try to 
query on those files using SolrJ, I get no output. Especially, I do not find 
correct results for numeric fields that I have specified in the schema.xml file 
in the config directory for my XML files. I have made those fields "indexed" 
and "stored" by using "indexed=true" and "stored=true". I am using the 
following code  in order to search for data (In the following code, I am trying 
to find out weight with values 21) - 

 SolrQuery query = new SolrQuery();
 query.setQueryType("dismax");
 query.setFacet(true);
 query.addFacetField("id");
 query.addFacetField("weight");
 query.setQuery("21");  
 QueryResponse qr = server.query(query);
 SolrDocumentList sdl = qr.getResults();

Am I doing anything wrong? Why do I get zero results even when there is a XML 
file with weight being 21. What are the other ways of doing the numeric queries 
in SolrJ ? 

Also, I would like to know how do I get the exact size of the index being 
generated by Solr. I am using a single machine to generate and query the index. 
When I look at the index directory, I see that the size of the files in the 
index directory is much lesser than the size reported by the "total" column in 
"ls -lh" command. Does anyone have any idea why is it the case? 

Thanks in advance. Waiting for your reply soon. 

Regards
Chaitali 



      

Reply via email to