Bouni / kicad-jlcpcb-tools

Plugin to generate BOM + CPL files for JLCPCB, assigning LCSC part numbers directly from the plugin, query the JLCPCB parts database, lookup datasheets and much more.
MIT License
1.19k stars 108 forks source link

keywords such as 5k 1% doesn't work #471

Open JLA4444 opened 6 months ago

JLA4444 commented 6 months ago

Describe the bug The % wildcard is causing issues as keywords as 5k 1% doesn't work

To Reproduce Steps to reproduce the behavior:

  1. Assign component
  2. keywords: 5k 1%
  3. You have to remove 1% for it to work

Expected behavior I expect it to be able to easily find precision resistors

KiCad Version

Bouni commented 4 months ago

Search terms ar split by space, so we end up with 5k and 1%. The first is ignored because its less that 3 characters wide, the later also but % needs to be escaped which I belive is nt done at the moment. I'll look into this tomorrow (or maybe in the evening, we'll see)

chmorgan commented 3 months ago

Tried this and seeing the same thing. Fortunately most resistor values are fractional with 3+ characters. There is likely some way we can force a db scan search on shorter tokens at the expense of performance.

Bouni commented 3 months ago

Maybe we add a search button that can trigger a search if the keyword is to short!?

chmorgan commented 3 months ago

Maybe there is an easy way to tell fts5 to do a table scan but it wasn’t apparent how to do so with the present syntax. We can always drop back to an alternate set of sql at the cost of additional code to maintain, and then use normal like or blob matching.

Maybe someone else knows how to do it. I ask on stack overflow.

Chris

On Fri, Aug 2, 2024 at 1:23 AM bouni @.***> wrote:

Maybe we add a search button that can trigger a search if the keyword is to short!?

— Reply to this email directly, view it on GitHub https://github.com/Bouni/kicad-jlcpcb-tools/issues/471#issuecomment-2264581077, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJH4AFOYB3P46G47N3CCPDZPMJVFAVCNFSM6AAAAABHKI77XWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRUGU4DCMBXG4 . You are receiving this because you commented.Message ID: @.***>