This mini-app uses Fluree's full-text capabilities to quickly through 25,000 recipes.
Features demonstrated: full-text search.
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.
Start the App
git clone https://github.com/fluree/fluree-recipe-example.git
cd fluree-recipe-example
npm install
npm start
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
.
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.
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, [email protected]
.
Or by Slack.