Skip to content

Version 0.5.0 Levenstein updates and fuzzy matching #45

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

Merged
merged 1 commit into from
Feb 9, 2018

Conversation

fbennett
Copy link
Contributor

  • Graceful Levenshtein updating of search list
  • Search queries as fuzzy match to each term, joined by AND
  • Force query words to lowercase
  • Fix an issue with failure of DOM updates on first search
  • Update README
  • Update changelog.txt

@fbennett
Copy link
Contributor Author

Hope this checks out okay in trials!

@Windyo
Copy link
Collaborator

Windyo commented Jan 23, 2018

I'll look at it this weekend, kinda swamped ATM.

Quick question: you changed from .4 to .5 - does that mean you're expecting breaking changes ?

Cheers

@fbennett
Copy link
Contributor Author

fbennett commented Jan 23, 2018

No rush at all. The changes require an id and a specific class attribute on result_template for screen updates to work correctly. It's a small change for theme developers, but if they have defined their own result_template and don't make the adjustment, screen updates will not work correctly.

@fbennett
Copy link
Contributor Author

I just force-pushed a further small change. Testing locally, we found that search could be broken if user made a search attempt immediately on first access to the site. Running indexing_start immediately when index generation is required helps protect against that glitch. No other impact.

@fbennett fbennett force-pushed the upstream-master branch 7 times, most recently from 0568be9 to a7bcd81 Compare January 25, 2018 15:03
@fbennett
Copy link
Contributor Author

Fixed a couple of other bugs, including what looks like a change in the way dates are handled in some contexts---the tool worked on our production server with MySQL and Ghost v1.20.0, and failed locally on a v1.20.3 sqlite3 installation. A tweak to normalize the date form for an API call fixed it. Should be pretty solid at this point.

@Windyo
Copy link
Collaborator

Windyo commented Jan 25, 2018 via email

@fbennett
Copy link
Contributor Author

Yeah, it got to be a little obsessive there for a bit. Should be settled now, though. Have a good weekend!

@fbennett
Copy link
Contributor Author

Rats. Searches are behaving weirdly on first-access with iOS devices. Erratically. Working on it, but not ready for merge yet. More soon ...

@fbennett
Copy link
Contributor Author

Pretty sure I found the problem. It looks to be a bug in lunr.js specfiic to iOS. I've filed a pull request to lunr.js with my hackity fix, and I'll update this item shortly to use a static copy of the lunr.js module for the nonce. More soon ...

@fbennett
Copy link
Contributor Author

There we go, the deed is done. We're now getting identical results without crashes on Linux and iOS devices. I've squashed everything into a single commit. I think this does it. 🤞

* Graceful Levenshtein updating of search list
* Search queries as fuzzy match to each term, joined by AND
* Force query words to lowercase
* Run index_start immediately if index requires updating.
  (the better to block search attempts until an index is available)
* Fix lunr.js bug affecting iOS systems, use static copy of module
* Use custom_excerpt for indexed description
* Update README
* Update changelog.txt
@fbennett
Copy link
Contributor Author

Added one more small tweak. The meta_description field does not (yet) return anything for posts. The user's hand-drafted description, if any, comes through in custom_excerpt, so I shifted to that instead for the description value in the index return.

@Windyo
Copy link
Collaborator

Windyo commented Feb 5, 2018

@fbennett I ahven't forgotten you, I got a bit swamped, sorry. I'll finish testing and put it live by Sunday barring any issues.

@fbennett
Copy link
Contributor Author

fbennett commented Feb 6, 2018

No worries at all. I know swamped.

@Windyo Windyo merged commit 0590366 into jamwise:master Feb 9, 2018
@Windyo
Copy link
Collaborator

Windyo commented Feb 9, 2018

thanks :)

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