{"html_url": "https://github.com/simonw/sqlite-utils/issues/198#issuecomment-722849539", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/198", "id": 722849539, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMjg0OTUzOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T05:39:17Z", "updated_at": "2020-11-06T05:39:17Z", "author_association": "OWNER", "body": "I'd have to copy almost all of the code in https://github.com/simonw/sqlite-fts4/blob/master/sqlite_fts4/__init__.py so I think I will add it as a dependency instead.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 737476423, "label": "Support order by relevance against FTS4"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/198#issuecomment-722852262", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/198", "id": 722852262, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMjg1MjI2Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T05:41:58Z", "updated_at": "2020-11-06T05:41:58Z", "author_association": "OWNER", "body": "Example query (from the tests):\r\n```sql\r\nselect c0, c1, rank_bm25(matchinfo(search, 'pcnalx')) as bm25\r\n from search where search match ?\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 737476423, "label": "Support order by relevance against FTS4"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/198#issuecomment-722895825", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/198", "id": 722895825, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMjg5NTgyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T06:29:17Z", "updated_at": "2020-11-06T06:29:17Z", "author_association": "OWNER", "body": "I released a 1.0 (and 1.0.1) version of https://github.com/simonw/sqlite-fts4", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 737476423, "label": "Support order by relevance against FTS4"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/198#issuecomment-723143633", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/198", "id": 723143633, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzE0MzYzMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T15:33:12Z", "updated_at": "2020-11-06T15:33:12Z", "author_association": "OWNER", "body": "Here's the FTS5 query:\r\n```sql\r\nwith original as (\r\n select\r\n rowid,\r\n *\r\n from [global-power-plants]\r\n)\r\nselect\r\n original.*,\r\n [global-power-plants_fts].rank as rank\r\nfrom\r\n [original]\r\n join [global-power-plants_fts] on [original].rowid = [global-power-plants_fts].rowid\r\nwhere\r\n [global-power-plants_fts] match :query\r\norder by\r\n rank desc\r\nlimit 20\r\n```\r\nThe equivalent using `rank_bm25()` for FTS4 would be:\r\n```sql\r\nwith original as (\r\n select\r\n rowid,\r\n *\r\n from [global-power-plants]\r\n)\r\nselect\r\n original.*,\r\n rank_bm25(matchinfo([global-power-plants_fts], 'pcnalx')) as rank\r\nfrom\r\n [original]\r\n join [global-power-plants_fts] on [original].rowid = [global-power-plants_fts].rowid\r\nwhere\r\n [global-power-plants_fts] match :query\r\norder by\r\n rank desc\r\nlimit 20\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 737476423, "label": "Support order by relevance against FTS4"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/198#issuecomment-723144893", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/198", "id": 723144893, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzE0NDg5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T15:35:45Z", "updated_at": "2020-11-06T15:35:45Z", "author_association": "OWNER", "body": "Here's a demo of that rank query. I had to sort by `rank` instead of `rank desc` - need to double-check that:\r\n\r\nhttps://datasette-sqlite-fts4.datasette.io/24ways-fts4?sql=with+original+as+(%0D%0A++++select%0D%0A++++++++rowid%2C%0D%0A++++++++*%0D%0A++++from+[articles]%0D%0A)%0D%0Aselect%0D%0A++++original.*%2C%0D%0A++++rank_bm25(matchinfo([articles_fts]%2C+%27pcnalx%27))+as+rank%0D%0Afrom%0D%0A++++[original]%0D%0A++++join+[articles_fts]+on+[original].rowid+%3D+[articles_fts].rowid%0D%0Awhere%0D%0A++++[articles_fts]+match+%3Aquery%0D%0Aorder+by%0D%0A++++rank%0D%0Alimit+20&query=jquery+maps", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 737476423, "label": "Support order by relevance against FTS4"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/198#issuecomment-723145383", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/198", "id": 723145383, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzE0NTM4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T15:36:47Z", "updated_at": "2020-11-06T15:36:47Z", "author_association": "OWNER", "body": "Should I register the custom `rank_bm25` SQLite function for every connection, or should I register it against the connection just the first time the user attempts an FTS4 search? I think I'd rather register it only if it is needed.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 737476423, "label": "Support order by relevance against FTS4"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/199#issuecomment-723147463", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/199", "id": 723147463, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzE0NzQ2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T15:41:00Z", "updated_at": "2020-11-06T15:41:00Z", "author_association": "OWNER", "body": "Something like this:\r\n```\r\n@db.register_function(replace=True)\r\ndef my_function(a):\r\n return a.upper()\r\n```\r\nIf `replace=True` then this function will be registered even if a `my_function` of arity 1 has already been registered previously.\r\n\r\nIt defaults to `False` though which means the Database object tracks what functions and arities have been registered in the past and silently ignores any new attempts to register the same name/arity.\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 737855731, "label": "@db.register_function(..., replace=False) to avoid double-registering custom functions"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/197#issuecomment-723148310", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/197", "id": 723148310, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzE0ODMxMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T15:42:43Z", "updated_at": "2020-11-06T15:42:43Z", "author_association": "OWNER", "body": "Having `.search()` return tuples when `.rows_where()` returns dictionaries just feels like bad API design to me - it's inconsistent. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 737153927, "label": "Rethink how table.search() method works"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/195#issuecomment-723148906", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/195", "id": 723148906, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzE0ODkwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T15:43:51Z", "updated_at": "2020-11-06T15:43:51Z", "author_association": "OWNER", "body": "Thanks to #198 (introducing a `rank_bm25()` custom function for FTS4) this feature will be able to offer relevance search for both FTS5 AND FTS4 tables.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735663855, "label": "table.search() improvements plus sqlite-utils search command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/197#issuecomment-723230732", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/197", "id": 723230732, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzIzMDczMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T18:24:29Z", "updated_at": "2020-11-06T18:24:29Z", "author_association": "OWNER", "body": "Still need to update docs.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 737153927, "label": "Rethink how table.search() method works"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/194#issuecomment-723234493", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/194", "id": 723234493, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzIzNDQ5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T18:32:34Z", "updated_at": "2020-11-06T18:32:34Z", "author_association": "OWNER", "body": "The breaking changes will be:\r\n\r\n- `table.search()` now returns a generator that produces dictionaries, similar to `table.rows_where()`\r\n- The `-c` shortcut no longer works, use `--csv` instead.\r\n- The `-f` shortcut no longer works, use `--fmt` instead.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 735650864, "label": "3.0 release with some minor breaking changes"}, "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-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/91#issuecomment-723350956", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/91", "id": 723350956, "node_id": "MDEyOklzc3VlQ29tbWVudDcyMzM1MDk1Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-06T23:53:25Z", "updated_at": "2020-11-06T23:53:25Z", "author_association": "OWNER", "body": "This is now possible, for both FTS4 and FTS5 - see #197.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 577302229, "label": "Enable ordering FTS results by rank"}, "performed_via_github_app": null}