Skip to main content

Building Search Indexes with Apache NiFi Streams

Building Search Indexes with Apache NiFi Streams

I can go to my Apache Solr dashboard hosted on Cloudera Data Platform - Data Center via port :8983/solr/#/

For those who have done the CFM or CDF Hands on Labs, we extend that lab to store to SOLR.

Login to Solr

Create a Collection for Your Data (sensors)

NiFi Flow (Data in, Output Records to Solr)

We need to configure the processor.   Just set Solr Type to Cloud, set Solr Location to URL:2181/solr and then pick your record reader ours is JSON.   You also need to select Fields to Index in the data.  In our JSON file I pick the timestamp and Id.

View The Collection To See Data Sent From NiFi

 To Query Via REST API


Example Collection Data

{ "responseHeader":{ "zkConnected":true, "status":0, "QTime":2, "params":{ "q":"*:*", "_":"1587566383627"}}, "response":{"numFound":153,"start":0,"docs":[ { "sensor_id":[73], "sensor_ts":[1587566202642550], "id":"e8652da3-dddf-4735-a187-799f95d2e362", "_version_":1664683988343586816}, { "sensor_id":[22], "sensor_ts":[1587566203806855], "id":"9bae2dff-e5ec-4751-b20e-f4d3a9c6e894", "_version_":1664683988399161344}, { "sensor_id":[10], "sensor_ts":[1587566204972747], "id":"4cc9dd26-e559-4368-b0c2-47095a0f78ab", "_version_":1664683988407549952}, { "sensor_id":[48], "sensor_ts":[1587566206142079], "id":"ba73b5d7-4c06-4202-8145-0f3437f37759", "_version_":1664683988415938560}, { "sensor_id":[9], "sensor_ts":[1587566207304793], "id":"be85793a-1c3c-46ab-96d8-14057e6a2e27", "_version_":1664683988422230016}, { "sensor_id":[77], "sensor_ts":[1587566208471159], "id":"94a1a150-2836-4b60-aafd-9b09fe2ac62a", "_version_":1664683988428521472}, { "sensor_id":[75], "sensor_ts":[1587566209635840], "id":"729b488c-7a75-49a8-9121-3e192bd84a81", "_version_":1664683988434812928}, { "sensor_id":[64], "sensor_ts":[1587566210807450], "id":"e6f76296-f70a-430d-a532-8040fbf4139e", "_version_":1664683988440055808}, { "sensor_id":[1], "sensor_ts":[1587566211973630], "id":"a3cb1028-76d1-4dba-a2ef-03b267d6714b", "_version_":1664683988447395840}, { "sensor_id":[33], "sensor_ts":[1587566213135150], "id":"dea6ea44-28ab-4d6e-9fad-b0ffaef69dcb", "_version_":1664683988454735872}] }}

Example Code

Reading From Apache SOLR

QuerySolr and PutKudu.

SOLR results in provenance.

# of Results (427)

QuerySolr parameters:   Cloud, Zookeeper URL:2181/solr, sensors, XML, *.*, /select

XML Results from SOLR convert to JSON


Popular posts from this blog

Ingesting Drone Data From DJII Ryze Tello Drones Part 1 - Setup and Practice

Ingesting Drone Data From DJII Ryze Tello Drones Part 1 - Setup and Practice In Part 1, we will setup our drone, our communication environment, capture the data and do initial analysis. We will eventually grab live video stream for object detection, real-time flight control and real-time data ingest of photos, videos and sensor readings. We will have Apache NiFi react to live situations facing the drone and have it issue flight commands via UDP. In this initial section, we will control the drone with Python which can be triggered by NiFi. Apache NiFi will ingest log data that is stored as CSV files on a NiFi node connected to the drone's WiFi. This will eventually move to a dedicated embedded device running MiniFi. This is a small personal drone with less than 13 minutes of flight time per battery. This is not a commercial drone, but gives you an idea of the what you can do with drones. Drone Live Communications for Sensor Readings and Drone Control You must connect t

NiFi on Cloudera Data Platform Upgrade - April 2021

CFM 2.1.1 on CDP 7.1.6 There is a new Cloudera release of Apache NiFi now with SAML support. Apache NiFi Apache NiFi Registry See:   For changes: Get your download on: To start researching for the future, take a look at some of the technical preview features around Easy Rules engine and handlers. Make sure you use the latest possible JDK 8 as there are some bugs out there.   Use a recent v

Using Apache NiFi in OpenShift and Anywhere Else to Act as Your Global Integration Gateway

Using Apache NiFi in OpenShift and Anywhere Else to Act as Your Global Integration Gateway What does it look like? Where Can I Run This Magic Engine: Private Cloud, Public Cloud, Hybrid Cloud, VM, Bare Metal, Single Node, Laptop, Raspberry Pi or anywhere you have a 1GB of RAM and some CPU is a good place to run a powerful graphical integration and dataflow engine.   You can also run MiNiFi C++ or Java agents if you want it even smaller. Sounds Too Powerful and Expensive: Apache NiFi is Open Source and can be run freely anywhere. For What Use Cases: Microservices, Images, Deep Learning and Machine Learning Models, Structured Data, Unstructured Data, NLP, Sentiment Analysis, Semistructured Data, Hive, Hadoop, MongoDB, ElasticSearch, SOLR, ETL/ELT, MySQL CDC, MySQL Insert/Update/Delete/Query, Hosting Unlimited REST Services, Interactive with Websockets, Ingesting Any REST API, Natively Converting JSON/XML/CSV/TSV/Logs/Avro/Parquet, Excel, PDF, Word Documents, Syslog, Kafka, JMS, MQTT, TCP