Noteplan full-text search for Alfred - some assembly required

Overview

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

Comments
  • Weekly notes

    Weekly notes

    Right now they work, but the title generated for them is all wrong. I'll hold off fixing this until 3.7.2 (I think) drops, with Monthly and Quarterly notes, and fix it in one pass

    opened by adamkiss 1
  • Improve readme

    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
    documentation 
    opened by adamkiss 0
  • Add a single entry point

    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');
    }
    
    enhancement wontfix 
    opened by adamkiss 0
  • Add new note folder selection flow

    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
    enhancement 
    opened by adamkiss 0
  • Visual: All calendar icons are the same

    Visual: All calendar icons are the same

    Replace them with something denoting daily / weekly / etc.

    Perhaps to keep it simple - just leave the daily icon as is, and replace the others with same orange, but big letter W, M, Q, Y?

    opened by adamkiss 0
  • Filter Search criteria

    Filter Search criteria

    Would it be possible to add a filter, so some of my Noteplan databases aren't searched with this workflow? I have internal archive folders, and this would be helpful.

    enhancement 
    opened by roamnovice 0
Releases(2.0.0-rc6)
Owner
Adam Kiss
Adam Kiss
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

TNT Studio 2.9k Jan 8, 2023
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

Winter CMS 5 Dec 20, 2022
Laravel search is package you can use it to make search query easy.

Laravel Search Installation First, install the package through Composer. composer require theamasoud/laravel-search or add this in your project's comp

Abdulrahman Masoud 6 Nov 2, 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'

FoolCode 318 Oct 21, 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

Ripa Club 62 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

Mark Manos 354 Nov 16, 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

Nicolás López Jullian 2k Dec 27, 2022
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

TNT Studio 1k Dec 27, 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

Tom Lingham 533 Nov 25, 2022
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

Spatie 94 Dec 14, 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.

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

Apache Solr for TYPO3 126 Dec 7, 2022
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

Spatie 219 Nov 8, 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

null 18 Dec 21, 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

JobApis 93 Nov 13, 2022
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

Sergey Shlyakhov 592 Dec 25, 2022
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

Maksim Surguy 215 Sep 8, 2022
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

Protone Media 844 Dec 25, 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

null 1 Jan 20, 2022
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

Spatie 1.1k Dec 31, 2022