Closed jhned closed 9 years ago
Ok, one issue with this: setting includeScore to true changes the data structure of the results array. It'll probably take significant refactoring to get it re-worked.
Flat results are displayed in order of Fuse score. Grouped results are also in order within their group.
We'll need to include the score of the search result, so that we can include the highest score for each section in a data-attribute, and then reorder the search result divs based on which one has the closest match.
The current order makes it seem like the search function isn't working correctly. For instance, if you search for "Lorem Ipsum," you should get a page as the closest match, but instead there are 5 posts that precede it.
We may want to consider including an option to flatten the results into a single list, with labels for the post type or taxonomy type on each individual item, rather than as a sub-heading.