/** * Returns the score of the best matching document.<p> * * @return the score of the best matching document */ public Float getMaxScore() { return m_resultDocuments.getMaxScore(); }
public Float getMaxScore() { return docs.getMaxScore(); }
public Float getMaxScore() { return docs.getMaxScore(); }
if (responseDocumentList != null) { final Float responseMaxScore = responseDocumentList.getMaxScore(); if (responseMaxScore == null) { LOG.trace("No maximum score info found in Solr query response. Results will not be normalized.");
public void writeSolrDocumentList(SolrDocumentList docs) throws IOException { writeTag(SOLRDOCLST); List<Number> l = new ArrayList<>(3); l.add(docs.getNumFound()); l.add(docs.getStart()); l.add(docs.getMaxScore()); writeArray(l); writeArray(docs); }
public void writeSolrDocumentList(SolrDocumentList docs) throws IOException { writeTag(SOLRDOCLST); List l = new ArrayList(3); l.add(docs.getNumFound()); l.add(docs.getStart()); l.add(docs.getMaxScore()); writeArray(l); writeArray(docs); }
public void writeSolrDocumentList(SolrDocumentList docs) throws IOException { writeTag(SOLRDOCLST); List<Number> l = new ArrayList<>(3); l.add(docs.getNumFound()); l.add(docs.getStart()); l.add(docs.getMaxScore()); writeArray(l); writeArray(docs); }
public boolean compareSolrDocumentList(Object expected, Object actual) { if (!(expected instanceof SolrDocumentList) || !(actual instanceof SolrDocumentList)) { return false; } if (expected == actual) { return true; } SolrDocumentList list1 = (SolrDocumentList) expected; SolrDocumentList list2 = (SolrDocumentList) actual; if (list1.getMaxScore() == null) { if (list2.getMaxScore() != null) { return false; } } else if (list2.getMaxScore() == null) { return false; } else { if (Float.compare(list1.getMaxScore(), list2.getMaxScore()) != 0 || list1.getNumFound() != list2.getNumFound() || list1.getStart() != list2.getStart()) { return false; } } for(int i=0; i<list1.getNumFound(); i++) { if(!compareSolrDocument(list1.get(i), list2.get(i))) { return false; } } return true; }
@Override public SolrDocumentList readSolrDocumentList(DataInputInputStream dis) throws IOException { SolrDocumentList solrDocs = new SolrDocumentList(); List list = (List) readVal(dis); solrDocs.setNumFound((Long) list.get(0)); solrDocs.setStart((Long) list.get(1)); solrDocs.setMaxScore((Float) list.get(2)); callback.streamDocListInfo( solrDocs.getNumFound(), solrDocs.getStart(), solrDocs.getMaxScore() ); // Read the Array tagByte = dis.readByte(); if( (tagByte >>> 5) != (ARR >>> 5) ) { throw new RuntimeException( "doclist must have an array" ); } int sz = readSize(dis); for (int i = 0; i < sz; i++) { // must be a SolrDocument readVal( dis ); } return solrDocs; } };) {
@Override public SolrDocumentList readSolrDocumentList(DataInputInputStream dis) throws IOException { SolrDocumentList solrDocs = new SolrDocumentList(); List list = (List) readVal(dis); solrDocs.setNumFound((Long) list.get(0)); solrDocs.setStart((Long) list.get(1)); solrDocs.setMaxScore((Float) list.get(2)); callback.streamDocListInfo( solrDocs.getNumFound(), solrDocs.getStart(), solrDocs.getMaxScore() ); // Read the Array tagByte = dis.readByte(); if( (tagByte >>> 5) != (ARR >>> 5) ) { throw new RuntimeException( "doclist must have an array" ); } int sz = readSize(dis); for (int i = 0; i < sz; i++) { // must be a SolrDocument readVal( dis ); } return solrDocs; } };
SolrDocumentList spellcheckResults = this.server.query(MapSolrParams.toSolrParams(newParams)).getResults(); if (results.getMaxScore() < spellcheckResults.getMaxScore()) { results = spellcheckResults;
SolrDocumentList spellcheckResults = this.externalServicesAccess.getSolrConnection(this).query(query).getResults(); if (results.getMaxScore() < spellcheckResults.getMaxScore()) { results = spellcheckResults;
SolrDocumentList spellcheckResults = this.externalServicesAccess.getServer().query(enhancedParams).getResults(); if (results.getMaxScore() < spellcheckResults.getMaxScore()) { results = spellcheckResults;
int f = flags(handle, "maxScore"); if (f == 0) { cmp = compare(a.getMaxScore(), b.getMaxScore(), 0, handle); if (cmp != null) return ".maxScore" + cmp; } else if ((f & SKIP) == 0) { // so we skip val but otherwise both should be present assert (f & SKIPVAL) != 0; if (b.getMaxScore() != null) { if (a.getMaxScore() == null) { return ".maxScore missing";
private void mergeDistributedResultsIntSingleResponse(ResponseBuilder rb, List<AcGroupResult> resultsToMerge, String responseTagName) { int docs = 0; float maxScore = 0.0f; // if groups have to be displayed in some custom order, other than the order specified in // ac_grouping_field_def String groupingSort = rb.req.getParams().get(AC_GROUPING_SORT_PARAM_NAME); if (groupSorts.containsKey(groupingSort)) { groupSorts.get(groupingSort).sort(rb, resultsToMerge); } SolrDocumentList docList = new SolrDocumentList(); // first find count of documents for (AcGroupResult acGroupResult : resultsToMerge) { // if slice contains more results than requested, take requested count; if it contains less results than // requested, we have to take what we got, not more docs += ((acGroupResult.getDistributedResultingDocs().size() > acGroupResult.getAcGroupingFieldValue().getRequestedCountOfSuggestions() == true) ? acGroupResult.getAcGroupingFieldValue().getRequestedCountOfSuggestions() : acGroupResult.getDistributedResultingDocs().size()); if (acGroupResult.getDistributedResultingDocs().getMaxScore() > maxScore) { maxScore = acGroupResult.getDistributedResultingDocs().getMaxScore(); } docList.addAll(acGroupResult.getDistributedResultingDocs()); } docList.setStart(0); docList.setNumFound(docs); rb.rsp.add(responseTagName, docList); }
@Override public KeywordSearchResults doKeywordSearch(InterMineAPI im, String queryString, Map<String, String> facetValues, List<Integer> ids, int offSet) { KeywordSearchPropertiesManager keywordSearchPropertiesManager = KeywordSearchPropertiesManager.getInstance(im.getObjectStore()); Vector<KeywordSearchFacetData> facets = keywordSearchPropertiesManager.getFacets(); QueryResponse resp = performSearch(im, queryString, facetValues, ids, offSet, keywordSearchPropertiesManager.PER_PAGE); SolrDocumentList results = resp.getResults(); Set<Integer> objectIds = getObjectIds(results); Map<Integer, InterMineObject> objMap = null; try { objMap = Objects.getObjects(im, objectIds); } catch (ObjectStoreException e) { LOG.error("ObjectStoreException for query term : " + queryString, e); } Vector<KeywordSearchResultContainer> searchHits = getSearchHits(results, objMap, results.getMaxScore()); Collection<KeywordSearchFacet> searchResultsFacets = parseFacets(resp, facets, facetValues); return new KeywordSearchResults(searchHits, searchResultsFacets, (int) results.getNumFound()); }
@Override public KeywordSearchResults doKeywordSearch(InterMineAPI im, String queryString, Map<String, String> facetValues, List<Integer> ids, int offSet) { KeywordSearchPropertiesManager keywordSearchPropertiesManager = KeywordSearchPropertiesManager.getInstance(im.getObjectStore()); Vector<KeywordSearchFacetData> facets = keywordSearchPropertiesManager.getFacets(); QueryResponse resp = performSearch(im, queryString, facetValues, ids, offSet, keywordSearchPropertiesManager.PER_PAGE); SolrDocumentList results = resp.getResults(); Set<Integer> objectIds = getObjectIds(results); Map<Integer, InterMineObject> objMap = null; try { objMap = Objects.getObjects(im, objectIds); } catch (ObjectStoreException e) { LOG.error("ObjectStoreException for query term : " + queryString, e); } Vector<KeywordSearchResultContainer> searchHits = getSearchHits(results, objMap, results.getMaxScore()); Collection<KeywordSearchFacet> searchResultsFacets = parseFacets(resp, facets, facetValues); return new KeywordSearchResults(searchHits, searchResultsFacets, (int) results.getNumFound()); }
writeLong(null,docs.getStart()); if (includeScore && docs.getMaxScore() != null) { writeMapSeparator(); writeKey("maxScore",false); writeFloat(null,docs.getMaxScore());
extras.put(SCORE_EXTRA, score); Float maxScore = documents.getMaxScore(); if (maxScore != null && score instanceof Number) { extras.put(NORMALIZED_SCORE_EXTRA, ((Number) score).floatValue() / maxScore);
SolrDocumentList results = response.getResults(); long numFound = results == null ? 0 : results.getNumFound(); Float maxScore = results == null ? null : results.getMaxScore();