{"html_url": "https://github.com/simonw/sqlite-utils/issues/192#issuecomment-723637930", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/192", "id": 723637930, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzYzNzkzMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-08T17:06:56Z", "updated_at": "2020-11-08T17:06:56Z", "author_association": "OWNER", "body": "This looks pretty good now!\r\n```\r\n% sqlite-utils search 24ways.db articles simon -c title -c author -t \r\ntitle author\r\n----------------------------------------------------------------------------- ------------------\r\nDon't be eval() Simon Willison\r\nDOM Scripting Your Way to Better Blockquotes Jeremy Keith\r\nSwooshy Curly Quotes Without Images Simon Collison\r\nThe Articulate Web Designer of Tomorrow Simon Collison\r\nWriting Responsible JavaScript Drew McLellan\r\nGoing Nuts with CSS Transitions Natalie Downe\r\nManaging a Mind Christopher Murphy\r\nDesign Systems Laura Kalbag\r\nBringing Your Code to the Streets Ruth John\r\nTaming Complexity Simon Collison\r\nUnobtrusively Mapping Microformats with jQuery Simon Willison\r\nCrafting the Front-end Ben Bodien\r\nDevelop Your Naturalist Superpowers with Observable Notebooks and iNaturalist Natalie Downe\r\nFast Autocomplete Search for Your Website Simon Willison\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735532751, "label": "sqlite-utils search command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/192#issuecomment-723357117", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/192", "id": 723357117, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzM1NzExNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-07T00:21:05Z", "updated_at": "2020-11-07T00:21:05Z", "author_association": "OWNER", "body": "I'm going to have it only output the exact `-c` columns you requested (if you requested any). Add `--rank` to specify the rank column, since you may not know what its name is.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735532751, "label": "sqlite-utils search command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/192#issuecomment-723348722", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/192", "id": 723348722, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzM0ODcyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T23:43:09Z", "updated_at": "2020-11-06T23:43:09Z", "author_association": "OWNER", "body": "Also that order looks incorrect. It looks like most relevant came back last, not first.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735532751, "label": "sqlite-utils search command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/192#issuecomment-723348614", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/192", "id": 723348614, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzM0ODYxNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T23:42:38Z", "updated_at": "2020-11-06T23:42:38Z", "author_association": "OWNER", "body": "This is a bit surprising:\r\n```\r\n(sqlite-utils) sqlite-utils % sqlite-utils search 24ways-fts4.db articles maps -c title \r\n[{\"rowid\": 41, \"title\": \"What Is Vagrant and Why Should I Care?\", \"rank\": -1.9252039178908076},\r\n {\"rowid\": 298, \"title\": \"First Steps in VR\", \"rank\": -1.9945466378736434},\r\n {\"rowid\": 43, \"title\": \"Content Production Planning\", \"rank\": -2.1928058363046143},\r\n {\"rowid\": 100, \"title\": \"Moo'y Christmas\", \"rank\": -2.2698482999851675},\r\n {\"rowid\": 91, \"title\": \"Infinite Canvas: Moving Beyond the Page\", \"rank\": -2.290928999035195},\r\n {\"rowid\": 175, \"title\": \"Front-End Code Reusability with CSS and JavaScript\", \"rank\": -2.498731782924352},\r\n {\"rowid\": 209, \"title\": \"Feeding the Audio Graph\", \"rank\": -2.619968930100356},\r\n {\"rowid\": 296, \"title\": \"Animation in Design Systems\", \"rank\": -2.62060151817201},\r\n {\"rowid\": 118, \"title\": \"Ghosts On The Internet\", \"rank\": -2.7224894534521087},\r\n {\"rowid\": 77, \"title\": \"Colour Accessibility\", \"rank\": -2.7389782859427343},\r\n {\"rowid\": 245, \"title\": \"Web Content Accessibility Guidelines 2.1\\u2014for People Who Haven\\u2019t Read the Update\", \"rank\": -2.9750992611162888},\r\n {\"rowid\": 56, \"title\": \"Helping VIPs Care About Performance\", \"rank\": -3.0819662908932535},\r\n {\"rowid\": 109, \"title\": \"Geotag Everywhere with Fire Eagle\", \"rank\": -3.1371975973877277},\r\n {\"rowid\": 203, \"title\": \"Jobs-to-Be-Done in Your UX Toolbox\", \"rank\": -3.2416719461682733},\r\n {\"rowid\": 276, \"title\": \"Your jQuery: Now With 67% Less Suck\", \"rank\": -3.4947916564653028},\r\n {\"rowid\": 58, \"title\": \"Beyond the Style Guide\", \"rank\": -3.7508321464447905},\r\n {\"rowid\": 225, \"title\": \"Good Ideas Grow on Paper\", \"rank\": -4.120077674716844},\r\n {\"rowid\": 168, \"title\": \"Unobtrusively Mapping Microformats with jQuery\", \"rank\": -4.662224207228984},\r\n {\"rowid\": 27, \"title\": \"Putting Design on the Map\", \"rank\": -5.667327088267961},\r\n {\"rowid\": 220, \"title\": \"Finding Your Way with Static Maps\", \"rank\": -9.952534352591737}]\r\n```\r\nI requested just `-c title` but also got back `rowid` and `rank`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735532751, "label": "sqlite-utils search command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/192#issuecomment-722054264", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/192", "id": 722054264, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMjA1NDI2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-05T00:44:39Z", "updated_at": "2020-11-05T00:44:39Z", "author_association": "OWNER", "body": "I want `.search()` to work against both FTS5 and FTS4 tables - but sort by rank should only work for FTS5.\r\n\r\nThis means I need to be able to introspect and tell if a table is FTS4 or FTS5.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735532751, "label": "sqlite-utils search command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/192#issuecomment-721453779", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/192", "id": 721453779, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMTQ1Mzc3OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-04T00:59:24Z", "updated_at": "2020-11-04T00:59:36Z", "author_association": "OWNER", "body": "FTS5 was added in SQLite 3.9.0 in 2015-10-14 - so about a year after CTEs, which means CTEs will always be safe to use with FTS5 queries.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735532751, "label": "sqlite-utils search command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/192#issuecomment-721420907", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/192", "id": 721420907, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMTQyMDkwNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-03T23:07:01Z", "updated_at": "2020-11-03T23:07:01Z", "author_association": "OWNER", "body": "I could depend on my `sqlite-fts4` library to solve this: https://github.com/simonw/sqlite-fts4\r\n\r\nOr I could say that only `FTS5` is supported for ranked searches - but still support `.search()` against FTS4 just without the option to sort by relevance.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735532751, "label": "sqlite-utils search command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/192#issuecomment-721420539", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/192", "id": 721420539, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMTQyMDUzOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-03T23:05:53Z", "updated_at": "2020-11-03T23:05:53Z", "author_association": "OWNER", "body": "Just realized there's a problem with the SQL I am using here: joining to get `rank` in this way only works against FTS5 tables, it doesn't work against FTS4.\r\n\r\n https://github.com/simonw/sqlite-utils/blob/c8a900df59efd34f394c863c0adff9912f1bf1d7/sqlite_utils/db.py#L1303-L1319", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735532751, "label": "sqlite-utils search command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/192#issuecomment-721319602", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/192", "id": 721319602, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMTMxOTYwMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-03T19:05:05Z", "updated_at": "2020-11-03T19:05:05Z", "author_association": "OWNER", "body": "Relevant example using a SQLite CTE: https://github.com/simonw/datasette/issues/268#issuecomment-675725464\r\n\r\nCTEs were added in SQLite 3.8.3 in 2014-02-03 so they should be safe to use. If someone tries to run `sqlite-utils search` no an older version of SQLite they'll get an error, which I think is OK.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735532751, "label": "sqlite-utils search command"}, "performed_via_github_app": null}