Permalink
Browse files

Use local solr filtered results in total search results count.

This modification has indeed low incidence as eventual query modifiers
are already applied when requesting the local solr index. 
It mainly impact doublons detected with results from remote peers.

Also updated javadocs for clarification.
  • Loading branch information...
luccioman committed Aug 30, 2017
1 parent 8b25b48 commit 3c9df6e0ce4e30f1e6c9f9e44a270c3cd18c4daf
Showing with 13 additions and 9 deletions.
  1. +13 −9 source/net/yacy/search/query/SearchEvent.java
@@ -224,32 +224,33 @@
public final boolean excludeintext_image;
// the following values are filled during the search process as statistics for the search
// In the next comments "filtering" is doubles checking and applying eventual search query constraints/modifiers
/** the number of hits generated/ranked by the local search in rwi index */
/** the number of hits generated/ranked by the local search in rwi index, after filtering */
public final AtomicInteger local_rwi_available;
/** the number of existing hits by the local search in rwi index */
/** the number of existing hits by the local search in rwi index, before any supplementary filtering */
public final AtomicInteger local_rwi_stored;
/** the number of hits imported from remote peers (rwi/solr mixed) */
/** the number of hits imported from remote peers (rwi/solr mixed + eventual site heuristics), after filtering */
public final AtomicInteger remote_rwi_available;
/** the number of existing hits at remote site */
/** the number of existing hits at remote sites, before any filtering */
public final AtomicInteger remote_rwi_stored;
/** the number of peers which contributed to the remote search result */
public final AtomicInteger remote_rwi_peerCount;
/** the number of hits generated/ranked by the local search in solr */
/** the number of hits generated/ranked by the local search in solr, after filtering */
public final AtomicInteger local_solr_available;
/** the number of existing hits by the local search in solr */
/** the number of existing hits by the local search in solr, before any supplementary filtering */
public final AtomicInteger local_solr_stored;
/** the number of hits imported from remote peers (rwi/solr mixed) */
/** the number of hits imported from remote peers (rwi/solr mixed), after filtering */
public final AtomicInteger remote_solr_available;
/** the number of existing hits at remote site */
/** the number of existing hits at remote site (rwi/solr mixed)*/
public final AtomicInteger remote_solr_stored;
/** the number of peers which contributed to the remote search result */
@@ -258,10 +259,13 @@
/** Ensure only one {@link #resortCachedResults()} operation to be performed on this search event */
public final Semaphore resortCacheAllowed;
/**
* @return the total number of results currently available and filtered (checking doubles and eventual query constraints/modifiers) from the different data sources
*/
public int getResultCount() {
return Math.max(
this.local_rwi_available.get() + this.remote_rwi_available.get() +
this.remote_solr_available.get() + this.local_solr_stored.get(),
this.remote_solr_available.get() + this.local_solr_available.get(),
imageViewed.size() + sizeSpare()
);
}

0 comments on commit 3c9df6e

Please sign in to comment.