Jump to content

Recommended Posts

Posted (edited)

This project is published on GitHub , the full document and download can be found here: https://github.com/MacHu-GWU/afwf_fts_anything-project

 

fts.anything is an Alfred Workflow allow you to custom full-text search on your own dataset. You can easily define which fields you want to search, how you want the data to be matched and send the result to other workflow to process.

 

Example:

 

50642330-cb9a8f00-0f38-11e9-8071-d012a18

 

The Data Set (IMDB Top 3 movies, content of ``movie.json``):

 

[
    {
        "description": "Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.",
        "genres": "Drama",
        "movie_id": 1,
        "title": "The Shawshank Redemption"
    },
    {
        "description": "The aging patriarch of an organized crime dynasty transfers control of his clandestine empire to his reluctant son.",
        "genres": "Crime,Drama",
        "movie_id": 2,
        "title": "The Godfather"
    },
    {
        "description": "The early life and career of Vito Corleone in 1920s New York City is portrayed, while his son, Michael, expands and tightens his grip on the family crime syndicate.",
        "genres": "Crime,Drama",
        "movie_id": 3,
        "title": "The Godfather: Part II"
    }
]

Search Setting (content of ``movie-setting.json``):

{
    "columns": [ // define search mode for each field
        {
            "name": "movie_id",
            "type_is_store": true
        },
        {
            "name": "title",
            "ngram_maxsize": 10,
            "ngram_minsize": 2,
            "type_is_ngram": true
        },
        {
            "name": "description",
            "type_is_phrase": true
        },
        {
            "keyword_lowercase": true,
            "name": "genres",
            "type_is_keyword": true
        }
    ],
    "title_field": "title", // title on Alfred drop down menu
    "subtitle_field": "description", // subtitle on Alfred drop down menu
    "arg_field": "movie_id", // argument for other workflow component
    "autocomplete_field": "{movie_id} - {title}", // tab auto complete behavior
    "icon_field": "/Users/<username>/.alfred-fts/movie-icon.png"
}

 

Edited by MacHu-GWU

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×