lib/picky/search.rb in picky-3.0.0.pre5 vs lib/picky/search.rb in picky-3.0.0
- old
+ new
@@ -82,33 +82,33 @@
# * offset = 0: _optional_ The offset from which position to return the ids. Useful for pagination.
#
# Note: The Rack adapter calls this method after unravelling the HTTP request.
#
def search text, ids = 20, offset = 0
- search_with tokenized(text), ids.to_i, offset.to_i
+ search_with tokenized(text), ids.to_i, offset.to_i, text
end
# Runs the actual search using Query::Tokens.
#
# Note: Internal method, use #search
#
- def search_with tokens, ids = 20, offset = 0
+ def search_with tokens, ids = 20, offset = 0, original_text = nil
results = nil
duration = timed do
- results = execute tokens, ids, offset
+ results = execute tokens, ids, offset, original_text
end
results.duration = duration.round 6
results
end
# Execute a search using Query::Tokens.
#
# Note: Internal method, use #search.
#
- def execute tokens, ids, offset
- Results.from ids, offset, sorted_allocations(tokens)
+ def execute tokens, ids, offset, original_text = nil
+ Results.from original_text, ids, offset, sorted_allocations(tokens)
end
# Delegates the tokenizing to the query tokenizer.
#
# Parameters:
\ No newline at end of file