Skip to content

separate search and score sorting operation#231

Open
jbouzekri wants to merge 1 commit intoolivernn:masterfrom
jbouzekri:unordered-search
Open

separate search and score sorting operation#231
jbouzekri wants to merge 1 commit intoolivernn:masterfrom
jbouzekri:unordered-search

Conversation

@jbouzekri
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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