ppshobi / psonic

Sonic is a super fast auto suggestion engine built by the team at crisp.chat, a customer engagement platform. its built in Rust and they officially support a javascript client, but if you want to use sonic via php, this is the library that you can look for. Completely unit tested, and adheres to modern coding standards, and offers a clean api to interact with sonic.
MIT License
130 stars 9 forks source link

Add offset and locale to search query #12

Closed skluck closed 5 years ago

skluck commented 5 years ago

Great library! This looks like by far the best sonic php lib.

This PR enables pagination of search queries which matches the protocol here: https://github.com/valeriansaliou/sonic/blob/master/PROTOCOL.md#3%EF%B8%8F%E2%83%A3-sonic-channel-search-mode

I also added locale since it was on the QueryCommand but not in the Search method.

codecov[bot] commented 5 years ago

Codecov Report

Merging #12 into master will decrease coverage by 0.41%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #12      +/-   ##
============================================
- Coverage     95.19%   94.78%   -0.42%     
- Complexity       82       83       +1     
============================================
  Files            22       22              
  Lines           229      230       +1     
============================================
  Hits            218      218              
- Misses           11       12       +1
Impacted Files Coverage Δ Complexity Δ
src/Commands/Search/QueryCommand.php 100% <100%> (ø) 4 <4> (+1) :arrow_up:
src/Search.php 83.33% <100%> (ø) 9 <3> (ø) :arrow_down:
src/Ingest.php 92.5% <0%> (-2.5%) 18% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1bbbf3c...2a5fbe8. Read the comment docs.

skluck commented 5 years ago

Hmm didn't touch Ingest so not sure how that coverage dropped...

It looks like the travis php7.1 build is not running because phpunit >= 7 doesn't support, not sure if that is related.

ppshobi commented 5 years ago

Hey @skluck. Thank you for your kind words. I will check why the tests were failing and merge ASAP. Thank you for the PR

ppshobi commented 5 years ago

The tests were failing because of Phpunit 8 drops support for php7.1. For now, I will lock the dependency on phpunit ~7.0, since we have few users still on php7.1. I will bump the version with another major release