Skip to content

This mini-app uses Fluree's full-text capabilities to quickly through 25,000 recipes.

License

Notifications You must be signed in to change notification settings

fluree/example-full-text-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fluree Recipe Example

This mini-app uses Fluree's full-text capabilities to quickly through 25,000 recipes.

Features demonstrated: full-text search.

Full Text App

Get Started

  1. Start Fluree

Download and unzip this Fluree packet. The packet contains Fluree, version 0.13.0, as well as a prepopulated database of recipes. All recipes are taken from Eight Portions.

Navigate to the folder where you downloaded the packet, and run ./fluree_start.sh. If you have Java 8+ installed, this should launch Fluree, and a Admin Console will be available for you to explore at http://localhost:8080. resources/example_queries.js has example queries you can test out directly in the Admin Console.

  1. Start the App
git clone https://github.com/fluree/fluree-recipe-example.git
cd fluree-recipe-example
npm install
npm start

How Does it Work

Full-Text Search

Fluree uses Apache Lucene to power our full-text search capabilities. Time-travel is NOT supported in full-text search, so search results only reflect the current Fluree ledger.

Full-text search is set to English, by default. We support 10 different languages in full-text search, including Chinese, Hindi, and Russian.

In order to enable full-text search on a predicate, _predicate/fullText has to be equal to true. For example, recipe/description has full-text search enabled:

{
    "_id": "_predicate",
    "name": "recipe/description",
    "type": "string",
    "fullText": true
}

You can see the full schema in ./resources/schema.json.

Query

The app is based on a single query:

{
    "select":   { "?recipe": [ { "*" : {"_compact":true }}]},
    "where":    [["?recipe","fullText:recipe","apples"]],
    "limit":    10,
    "offset":   0
}

The search term (in the example above, apples) changes depending on the query, and the offset changes to support pagination.

You can try out this and other queries by going to http://localhost:8080. resources/example_queries.js has example queries you can test out directly in the Admin Console.

Full Text Queries

Resources

To see more example projects, visit our example repo.

Check out our entire documentation or jump directly to the section on full-text search.

You can also engage with us via email, support@flur.ee.

Or by Slack.

About

This mini-app uses Fluree's full-text capabilities to quickly through 25,000 recipes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published