private static void displayResults(List<QueryWord> queryWords,
			List<DocDetails> relevantDocs, int depthIndex, Set<Integer> shownResults) throws IOException{
		//List<Double> idfs=new ArrayList<>();
		List<Double> tfs=new ArrayList<>();
		Map<Double,List<Integer>> cosAngle=new TreeMap<>(Collections.reverseOrder()); 
		/*for(int i=0;i<depthIndex;i++){
			tfs.add(1d);
			idfs.add(queryWords.get(i).getIdf());
		}
		
		List<Double> queryUnitVector=getUnitVector(idfs, tfs);*/
		List<DocDetails> matchedDocs;
		List<Double> docUnitVector;
		List<Integer> docIds;
		double distance=0d;
		for(DocDetails docDetail:relevantDocs){
			
			if(shownResults.contains(docDetail.getDocId()))
				continue;
			
			tfs=new ArrayList<>();
			distance=0d;
			matchedDocs=docDetail.getResultDocs();
			for( int i=0;i<depthIndex;i++){
				//tfs.add(matchedDocs.get(i).getTf());
				distance+=matchedDocs.get(i).getTf();
			}
			/*docUnitVector=getUnitVector(idfs, tfs);
			
			for(int i=0;i<depthIndex;i++){
				distance+=docUnitVector.get(i)*queryUnitVector.get(i);
			}*/
			docIds = cosAngle.get(distance);
			if(docIds == null){
				docIds=new ArrayList<>();
			}
			docIds.add(docDetail.getDocId());
			cosAngle.put(distance, docIds);
		}
		
		int numOfResults=0,beginIndex,endIndex;
		String title;
		
		List<Integer> showingDocIds=new ArrayList<>();
		for(Double dist:cosAngle.keySet()){
			for(Integer docId:cosAngle.get(dist)){
				if(shownResults.size() >= ParsingConstants.MIN_RESULTSET)
					break;
				title=getTitle(docId);
				if(title == null)
					continue;
				beginIndex=title.indexOf(ParsingConstants.wordDelimiter);
				//System.out.println(docId+"  "+ dist +"  " +title.substring(beginIndex+1));
				showingDocIds.add(docId);
				shownResults.add(docId);	
				
			}
			if(shownResults.size() >= ParsingConstants.MIN_RESULTSET)
				break;
		}
		displayTitles(showingDocIds);
	}