Noteplan full-text search for Alfred - some assembly required

Last update: Apr 30, 2022

Noteplan FTS for Alfred

OG Social image

Noteplan full-text search for Alfred - some assembly required. Work in progress, mostly working.


Usage

  • n [Search phrase] - Full text search. If there isn't any note available, "Create new note" command is the only result
  • nn Title of the note - Creates a new note, in the folder of your choice
  • nref - Refresh SQLite database

Requirements

  • PHP install available in CLI
  • SQLite with fts5 enabled (available by default in the SQLite "amalgamation" build bundled with Homebrew PHP)

Installation

  1. Ensure you have all the requirements (Homebrew, PHP) installed
  2. Clone this repository to your alfred workflows folder (or elsewhere and symlink it)
  3. Create _config.php, which at minimum contains absolute path to your noteplan document root
    • You can find it in Settings: Settings → Sync → [Sync method] → Advanced → Open Local Database Folder
    • "root" is the folder that containes all your things - Backups, Notes, Calendar items, templates. Everything.
  4. Run nref in the Alfred to generate your sqlite cache for the first time
  5. Run nref everytime you close the Noteplan app, or setup any kind of automation for a periodical run of the alred caching action. There are multiple options for this, and it depends on what you're the most comfortable with.

Minimal _config.php example:

 
return [
  'noteplan_root' => '/absolute/path/to/noteplan/'
];

Example periodic cache refresh with Keyboard Maestro

For 500 notes, current runtime of the note import script is ~500ms, which is fast enough to have it setup to run every time Noteplan window loses its focus. This is how I have it currently setup:

Keayboard Maestro setup

Edit: I've now updated the script to run a minute after Noteplan was deactivated, with a bit of logic to cancel previous waiting runs of the keyboard maestro script, which is useful if you're transferring data between noteplan and other apps. You can find the macro to import in the additional/ folder, just don't forget to edit the absolute path to the run-cache-sqlite.php file in your workflow folder.

This repository also contains

  • experimental ripgrep version - databaseless version of full-text search: PHP parses input, prepares ripgrep search, and then formats the results. Available via command nrg, which will be removed in future updates.
  • experimental nodejs version - this one is super dirty/simple testing version, where I tried if it would be possible to do the sqlite access/formatting via packaged, standalone nodejs script for users with no programming experience. It is possible, but due to requirements like codesigning (Apple Developer Program yearly licenses, etc.), will probably not be developed further. Rough testing search version available as njs.

License

MIT License


© 2022 Adam Kiss

GitHub

https://github.com/adamkiss/alfred-noteplan-fts
You might also like...

A site search engine

A site search engine

THIS PACKAGE IS IN DEVELOPMENT, DO NOT USE IN PRODUCTION YET A site search engine This package can crawl your entire site and index it. Support us We

May 13, 2022

Support search in flarum by sonic

flarum-sonic Support search by Sonic Install Sonic following this guide Install the extension: composer require ganuonglachanh/sonic Change info in a

Apr 27, 2022

Your personal job-search assistant

JobsToMail Your personal job-search assistant About JobsToMail is an open source web application that allows users to sign up to receive emails with j

Apr 7, 2022

Search among multiple models with ElasticSearch and Laravel Scout

Search among multiple models with ElasticSearch and Laravel Scout

For PHP8 support use php8 branch For Laravel Framework 6.0.0 use 3.x branch The package provides the perfect starting point to integrate ElasticSear

May 19, 2022

This is an open source demo of smart search feature implemented with Laravel and Selectize plugin

This is an open source demo of smart search feature implemented with Laravel and Selectize plugin

Laravel smart search implementation See demo at: http://demos.maxoffsky.com/shop-search/ Tutorial at: http://maxoffsky.com/code-blog/laravel-shop-tuto

Sep 16, 2021

Laravel package to search through multiple Eloquent models. Supports sorting, pagination, scoped queries, eager load relationships and searching through single or multiple columns.

Laravel Cross Eloquent Search This Laravel package allows you to search through multiple Eloquent models. It supports sorting, pagination, scoped quer

May 18, 2022

This modules provides a Search API Backend for Elasticsearch.

Search API ElasticSearch This modules provides a Search API Backend for Elasticsearch. This module uses the official Elasticsearch PHP Client. Feature

Jan 20, 2022

Laravel Searchable - This package makes it easy to get structured search from a variety of sources

Laravel Searchable - This package makes it easy to get structured search from a variety of sources

This package makes it easy to get structured search from a variety of sources. Here's an example where we search through some model

May 24, 2022

Search products, categories, brands or tags with ElasticSearch

ElasticSearch for Shopaholic This plugin allows you to use ElasticSearch as search engine for Shopaholic. Benefits Easy to install, easy to use Opened

Feb 18, 2022
Comments
  • 1. Improve readme

    Note:

    • some assembly required
    • requirements (php / php via brew, ripgrep for the rg version)
    • need to create a _config.php (separate Alfred action?)
    • configuration options
    • keyboard maestro/CRON caching for sqlite
    Reviewed by adamkiss at 2022-04-18 13:03
  • 2. Add a single entry point

    Currently, both ripgrep and sqlite versions have a separate entry point. Ideally, for the smoother setup, there should be a single entry point for both of them, with the preferred version configured.

    I imagine something like this:

    <?php
    $config = []; // merge defaults and _config
    
    if ($config['use_sqlite']) {
      require_once('run-sqlite.php');
    } else {
      require_once('run-ripgrep.php');
    }
    
    Reviewed by adamkiss at 2022-04-18 13:02
  • 3. Add new note folder selection flow

    When user selects "create new note 'XYZ'", they should be presented with a list of folders. This is going to be a separate script filter, able to be run separately with nn, sorted by Alfred.

    • get recursively all folders of NOTEPLAN_ROOT/Notes
    • filter away ^@ folders - @Trash, @Archive, @Templates
    • filter away _attachments$ folders
    • set the same callback url - create note, note content and subwindow options are the same, only the folder param changes
    Reviewed by adamkiss at 2022-04-18 13:00
A fully featured full text search engine written in PHP
A fully featured full text search engine written in PHP

TNTSearch TNTSearch is a full-text search (FTS) engine written entirely in PHP. A simple configuration allows you to add an amazing search experience

May 20, 2022
Enables full-text search capabilities in Winter.

Search Plugin Adds full-text searching capabilities to Winter, built on the foundations of Laravel Scout. The plugin acts primarily as a wrapper for L

May 12, 2022
SphinxQL Query Builder generates SphinxQL, a SQL dialect, which is used to query the Sphinx search engine. (Composer Package)

Query Builder for SphinxQL About This is a SphinxQL Query Builder used to work with SphinxQL, a SQL dialect used with the Sphinx search engine and it'

May 20, 2022
Sphinx Search library provides SphinxQL indexing and searching features

Sphinx Search Sphinx Search library provides SphinxQL indexing and searching features. Introduction Installation Configuration (simple) Usage Search I

Mar 14, 2022
A search package for Laravel 5.

Search Package for Laravel 5 This package provides a unified API across a variety of different full text search services. It currently supports driver

Mar 17, 2022
A php trait to search laravel models

Searchable, a search trait for Laravel Searchable is a trait for Laravel 4.2+ and Laravel 5.0 that adds a simple search function to Eloquent Models. S

May 17, 2022
Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch
Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

TNTSearch Driver for Laravel Scout - Laravel 5.3 - 8.0 This package makes it easy to add full text search support to your models with Laravel 5.3 to 8

May 17, 2022
Unmaintained: Laravel Searchy makes user driven searching easy with fuzzy search, basic string matching and more to come!

!! UNMAINTAINED !! This package is no longer maintained Please see Issue #117 Here are some links to alternatives that you may be able to use (I do no

May 2, 2022
Build and execute an Elasticsearch search query using a fluent PHP API
Build and execute an Elasticsearch search query using a fluent PHP API

PACKAGE IN DEVELOPMENT, DO NOT USE YET Build and execute ElasticSearch queries using a fluent PHP API This package is a lightweight query builder for

May 5, 2022
A TYPO3 extension that integrates the Apache Solr search server with TYPO3 CMS. dkd Internet Service GmbH is developing the extension. Community contributions are welcome. See CONTRIBUTING.md for details.
A TYPO3 extension that integrates the Apache Solr search server with TYPO3 CMS. dkd Internet Service GmbH is developing the extension. Community contributions are welcome. See CONTRIBUTING.md for details.

Apache Solr for TYPO3 CMS A TYPO3 extension that integrates the Apache Solr enterprise search server with TYPO3 CMS. The extension has initially been

Apr 22, 2022