Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate search and score sorting operation #231

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

separate search and score sorting operation #231

wants to merge 1 commit into from

Conversation

jbouzekri
Copy link

This pull request proposes to separate the search operation in a baseSearch method to give the ability to get the search results without always sorting by score.

@olivernn
Copy link
Owner

olivernn commented Sep 5, 2016

I'm not saying that this isn't something that will be possible in lunr, but I don't understand what the requirement for being able to get the results unsorted is? Could you explain your use case for this feature?

@jbouzekri
Copy link
Author

It is not that I want it unsorted, it is more that I want to sort it in another order without having to do 2 sort operations.

For example :

search('text')
  .map(doc => my_database[doc.ref])
  .sort((function (a, b) {
       return b.publication_date - a.publication_date
   })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants