Menu
e-lo
  • Home
    • Tech
    • Inspiration and about
  • Database
    • T-SQL
    • SQL Server quick
    • SQL server docs
    • MySql quick sheet
    • Postgre
    • InfluxDB
  • Programming
    • Automating the boring stuff
    • Python 101
    • Python Docs
    • Python Logging
    • cSharp Overview
    • Powershell Latest
    • Powershell 4 lang ref
    • MS Azure PS ref
    • MS Azure CLI ref
  • Azure
    • AZ-104-MS Azure Administrator 101 quick ref
    • AZ-104 Lab
    • MS Windows virtual machines in Azure
    • MS ARM Docs
    • MS ARM Tutorial
    • MS Deployment scripts (intern/extern)
    • ARM Quickstart
    • MS ARM templates 4h
  • Az Adm
    • AD 101
    • Governance and Compliance 102
    • Administration 103
    • Virtual Networking 104
    • Storage 107 (With table (NoSQL and more))
    • Virtual Machines 108
    • Azure Virtual Machines 101
    • Monitor VM (and market)
  • Linux
    • Top CMD’s
    • Useful CMD Linux
    • ss64 Linux
    • Ubuntu
    • 30 things Ubuntu 18.04
  • Zen
    • Not thinking about anything is Zen
e-lo

Apache Solr 7.5 Build book_store index insert/update/delete

Posted on October 8, 2018October 23, 2018 by espenk

We are starting from:

Your Solr server is up and running, but it doesn’t contain any data yet, so we can’t do any queries, but we will use our own data and create our own index.

in:

https://lucene.apache.org/solr/guide/7_5/solr-tutorial.html#exercise-1

 

Quick recap:

Start cloud mode: bin\solr.cmd start -e cloud

We will create a collection called book_store with configuration _default. Ie following the parameter in tutorial 2, but changed the name and the configuration.

We start with 1 node on default port

bin\solr.cmd start -e cloud

(if the collection is existing just type for 1 for use existing, stop node1, bin\solr.cmd stop -p 8983)

1 node, running on default port 8983, shared is 1, replicas is 1.

We will keep this to just 1 and simple.

Our node1 is empty now:

 

Here the index will come after we have create it with the parameters above.

Now we can visit the collection in the gui and also our index is created, but it is empty:

 

 

In the gui, we select our collection, and lets insert some items:

We will use the query tab, lets look at out index:

The query we make will also give us the http query to paste in a browser:

select all from collection:

http://localhost:8983/solr/book_store/select?q=*:*

 

Lets insert one json book manually, since we do not have the DataImportHandler defined.

We insert in the documents tab and submit.

 

Lets run the select again:

And there is our first book in the index cool.

Ok, we will stop Solr:

bin\solr.cmd stop -p 8983

Starting up again is just same steps as in the begining, and you could also provide the paramters in the bat file

Now, lets insert some more documents and add a custom field to default schema.xml.

We will add a string field tag:

Now lets insert a new book with the custom field ( the two other books is already updated)

Lets paste the query in a browser( could also use the admin):

http://localhost:8983/solr/book_store/select?q=*:* and view our result:

And here it is, looks good!

Now lets delete a doc,

<delete><query>id:978-1423103349</query></delete>

 

And now we only have two documents:

 

Then we have done insert, updated and deleted documents.

TBC (add python with DataImportHandler)

 

 

 

 

 

 

 

RSS Azure

  • Azure and HITRUST publish shared responsibility matrix January 14, 2021

RSS Python

  • PEP 651: Robust Stack Overflow Handling January 18, 2021

Cloud

ARM (8) azure (23) cmd (1) Django (4) Docker (1) e-lo (2) Flask (2) Github (9) Grafana (2) Information (1) Information Retrieval (11) JAVA (1) kivy (2) Kotlin (4) linux (11) mobile (2) Natural Language Prossesing (NLP) (2) Net.Core (1) Networking and Security (2) OPC (2) PEP8 (1) Philosophy (3) Python (41) Python Networking and Security (2) Reason (2) RMQ (2) Solr (11) Sql (10) VSC (1) Warframe (2) WMVARE (4) Zabbix (7)

Recent Posts

  • 1 TODO ARM Lab 105 MS (Deployment create a pipeline)
  • 2 TODO MS ARM Template 4h
  • TODO Cryptography with Python – Caesar Cipher
  • 3 TODO Udemy AZ-104 Microsoft Azure Administrator Exam Certification (Scott Duffy)
  • ARM Lab 104 MS (Deployment and more)

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2021 e-lo | Powered by WordPress & Superb Themes