Hi,

I am facing problem to get facet result count. I must be wrong somewhere.
I am getting proper result count when searching by single word, but when
searching by string then result count become wrong.

for example : -
search keyword : Bagdad bomb blast.
I am getting 5 result count for facet country. but when clicking on the
facet browser actual value is more then 5.
When searching by "bagdad" then result count is fine.

when using url to check the response for string

http://localhost:8080/solr/core0/select?q=bagdad bomb
blast&facet=on&facet.field=type&fq=type:news

it giving the result count 8 which is right.

I am using solrj client. following is my code:-


                       query.setFacet(true);
// query.addFacetQuery("type:"+)
query.addFacetField("type");
query.addFacetQuery(qq);
query.setFacetSort("index");

                       List<FacetField> listFacet = rsp.getFacetFields();

Iterator<FacetField> itr = listFacet.iterator();
log.info(listFacet.size());
for (int i = 0; i < listFacet.size(); i++) {
FacetField facetField = itr.next();
List<FacetField.Count> fList = facetField.getValues();
if (fList == null) {
break;
}
log.info(fList.size());
Iterator<FacetField.Count> flistItr = fList.iterator();
for (int j = 0; j < fList.size(); j++) {
FacetField.Count ff = flistItr.next();
labelValueBean = new LabelValueBean();

labelValueBean.setLabel(ff.getName());
labelValueBean.setValue(Long.toString(ff.getCount()));
log.info(ff.getName() + ":" + ff.getCount());
listLabelValueBean.add(labelValueBean);

}

}


please help..

thanks
with regards

Reply via email to