Getting started with Mahuta - A Search engine for the IPFS
Greg Jeanmart
Mahuta (formerly known as IPFS-Store) is a convenient library and API to aggregate and consolidate files or documents stored by your application on the IPFS network. It provides a solution to collect, store, index and search data used.
Features
Indexation: Mahuta stores documents or files on IPFS and index the hash with optional metadata.
Discovery: Documents and files indexed can be searched using complex logical queries or fuzzy/full text search)
Scalable: Optimised for large scale applications using asynchronous writing mechanism and caching
Replication: Replica set can be configured to replicate (pin) content across multiple nodes (standard IPFS node or IPFS-cluster node)
Multi-platform: Mahuta can be used as a simple embedded Java library for your JVM-based application or run as a simple, scalable and configurable Rest API.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
IndexingResponse response = mahuta.prepareStringIndexing("article", "## This is my first article") .contentType("text/markdown") .indexDocId("article-1") .indexFields(ImmutableMap.of("title", "First Article", "author", "greg")) .execute();
curl -X POST \ http://localhost:8040/mahuta/config/index/article \ -H 'Content-Type: application/json'
Success Response:
Code: 200 Content:
1 2 3
{ "status": "SUCCESS" }
Store and index an article and its metadata
Sample Request:
1 2 3 4
curl -X POST \ 'http://localhost:8040/mahuta/index' \ -H 'content-type: application/json' \ -d '{"content":"# Hello world,\n this is my first file stored on **IPFS**","indexName":"article","indexDocId":"hello_world","contentType":"text/markdown","index_fields":{"title":"Hello world","author":"Gregoire Jeanmart","votes":10,"date_created":1518700549,"tags":["general"]}}'