olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.96k stars 548 forks source link

Remebering Recent Search Values #87

Closed apijedi closed 10 years ago

apijedi commented 10 years ago

Hi,

After the search results are returned and done. I want to be able to see what my recent searches. Basically I am trying to find a way to remember recent searches. Any ideas..

olivernn commented 10 years ago

This doesn't sound like something lunr should implement as it is quite specific to your use case.

It sounds like to me that you need to store the results of a search, so that you can later retrieve them again, perhaps something like this:

var results = idx.search(query)
resultCache[query] = results

This way you could get access to the searches you have made, and the results that were returned.