private Object getResult(boolean isdetail,SolrIndexSearcher searcher,SolrParams params,SolrQueryRequest req,String[] fields, DocSet base)throws Exception
{
String crcget=params.get("mdrill.crc.key.get",null);
if(crcget!=null&&(params.getBool("fetchfdt", false)||isdetail))
{
SolrIndexReader reader=searcher.getReader();
IndexReader.InvertParams invparam=new IndexReader.InvertParams();
invparam.searcher=searcher;
invparam.params=params;
invparam.fields=fields;
invparam.base=base;
invparam.req=req;
invparam.isdetail=isdetail;
IndexReader.InvertResult result=reader.invertScan(searcher.getSchema(), invparam);
ArrayList<NamedList> resultlist=result.getResult();
Map<Long,String> crcvalue=new HashMap<Long,String>();
for(NamedList nl:resultlist)
{
crcvalue.putAll((Map<? extends Long, ? extends String>) nl.get("fdtcre"));
}
return crcvalue;
}
if(crcget!=null)
{
ConcurrentHashMap<Long,String> cache=MdrillUtils.CRC_CACHE_SIZE.remove(crcget);
Map<Long,String> crcvalue=new HashMap<Long,String>();
if(cache==null)
{
return crcvalue;
}
String crcliststr=params.get("mdrill.crc.key.get.crclist");
if(crcliststr!=null)
{
String[] crclist=crcliststr.split(",");
for(String s:crclist)
{
Long crc=Long.parseLong(s);
String v=cache.get(crc);
if(v!=null)
{
crcvalue.put(crc, v);
}
}
}
return crcvalue;
}
SolrIndexReader reader=searcher.getReader();
IndexReader.InvertParams invparam=new IndexReader.InvertParams();
invparam.searcher=searcher;
invparam.params=params;
invparam.fields=fields;
invparam.base=base;
invparam.req=req;
invparam.isdetail=isdetail;
IndexReader.InvertResult result=reader.invertScan(searcher.getSchema(), invparam);
ArrayList<NamedList> resultlist=result.getResult();
if(resultlist.size()==1)
{
return resultlist.get(0);
}