Skip to content

Commit

Permalink
changed strategy for dropping duplicates (fixes #137)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Jan 30, 2019
1 parent 98172a9 commit 7604180
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions r-pkg/R/es_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ es_search <- function(es_host
)
log_fatal(msg)
}

# assign 1 core by default, if the number of cores is NA
if (is.na(n_cores) || !assertthat::is.count(n_cores)){
msg <- "detectCores() returned NA. Assigning number of cores to be 1."
Expand Down Expand Up @@ -397,7 +397,7 @@ es_search <- function(es_host

# It's POSSIBLE that the parallel process gave us duplicates. Correct for that
data.table::setkeyv(outDT, NULL)
outDT <- unique(outDT)
outDT <- unique(outDT, by = "_id")

# Check we got the number of unique records we expected
if (nrow(outDT) < hits_to_pull && break_on_duplicates){
Expand Down

0 comments on commit 7604180

Please sign in to comment.