SlideShare a Scribd company logo
1 of 3
To start solr
=============
C:Program Filessolr-5.4.0bin> solr start -f
C:Program Filessolr-5.4.0bin> solr start -f -p 8983
Note: start the service as a foreground process using -f, otherwise restart will
not work with background process
--------------------------------------------------------------------------------
------------------------------------------------------
To stop solr
============
C:Program Filessolr-5.4.0bin> solr stop -f -p 8983
C:Program Filessolr-5.4.0bin> solr stop -f -all
--------------------------------------------------------------------------------
------------------------------------------------------
To restart solr
===============
C:Program Filessolr-5.4.0bin> solr restart -f -p 8983
--------------------------------------------------------------------------------
------------------------------------------------------
To validate solr
================
http://localhost:8983/solr/
********************************************************************************
******************************************************
Configuration
********************************************************************************
******************************************************
Creating a Core
===============
C:Program Filessolr-5.4.0bin> solr create -c csvcore -d basic_configs -p
8983
C:Program Filessolr-5.4.0bin> solr create -c jsoncore -d basic_configs -p
8983
C:Program Filessolr-5.4.0bin> solr create -c xmlcore -d basic_configs -p
8983
Deleting a Core
===============
C:Program Filessolr-5.4.0bin> solr delete -c csvcore -p 8983
C:Program Filessolr-5.4.0bin> solr delete -c jsoncore -p 8983
C:Program Filessolr-5.4.0bin> solr delete -c xmlcore -p 8983
Explanation
-----------
-c <name> - Name of the core or collection to create (required).
-d <confdir> - The configuration directory, useful in the SolrCloud mode.
-n <configName> - The configuration name. This defaults to the same name as the
core or collection.
-p <port> - Port of a local Solr instance to send the create command to; by
default the script tries to detect the port by looking for running Solr
instances.
-s <shards> - Number of shards to split a collection into, default is 1.
-rf <replicas> - Number of copies of each document in the collection. The
default is 1.
--------------------------------------------------------------------------------
------------------------------------------------------
Modify the schema.xml file
==========================
For CSV data - C:Program Filessolr-5.4.0serversolrcsvcoreconfschema.xml
------------
<uniqueKey>id</uniqueKey>
<!-- Fields added for books.csv load-->
<field name="cat" type="text_general" indexed="true"
stored="true"/>
<field name="name" type="text_general" indexed="true"
stored="true"/>
<field name="price" type="tdouble" indexed="true"
stored="true"/>
<field name="inStock" type="boolean" indexed="true"
stored="true"/>
<field name="author" type="text_general" indexed="true"
stored="true"/>
For JSON data - C:Program Filessolr-5.4.0serversolrjsoncoreconfschema.xml
-------------
<uniqueKey>id</uniqueKey>
<!-- Added for Multi value example -->
<field name="name" type="text_general" indexed="true"
stored="true"/>
<field name="cat" type="text_general" indexed="true"
stored="true" multiValued="true"/>
<field name="price" type="tdouble" indexed="true"
stored="true"/>
<field name="inStock" type="boolean" indexed="true"
stored="true"/>
<field name="author" type="text_general" indexed="true"
stored="true"/>
For XML data
------------
Since the default data format is xml, schema definition is not necessary
Explanation
-----------
name: Name of the field required
type: Field type required
indexed: Should this field be added to the inverted index? optional
stored: Should the original value of this field be stored? optional
multiValued: Can this field have multiple values? optional
Restart solr to reflect the changes
-----------------------------------
C:Program Filessolr-5.4.0bin> solr restart -f -p 8983
--------------------------------------------------------------------------------
------------------------------------------------------
Indexing the Data
=================
C:Program Filessolr-5.4.0exampleexampledocs> java -Dtype=text/csv
-Durl=http://localhost:8983/solr/csvcore/update -jar post.jar books.csv
C:Program Filessolr-5.4.0exampleexampledocs> java -Dtype=text/json
-Durl=http://localhost:8983/solr/jsoncore/update -jar post.jar books.json
C:Program Filessolr-5.4.0exampleexampledocs> java -Dtype=text/xml
-Durl=http://localhost:8983/solr/xmlcore/update -jar post.jar *.xml
Explanation
-----------
-Dtype -> the type of the data file.
JSON file: text/json, application/json
XML files: text/xml, application/xml
CSV file: text/csv, application/csv
-Durl -> URL for the core.
********************************************************************************
******************************************************
Access the Indexed documents
********************************************************************************
******************************************************
C:Program Filessolr-5.4.0bin> solr -e techproducts -f -p 8983
Querying Data
=============
http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&fl=name,id
http://localhost:8983/solr/#/techproducts/query?
indent=on&q=video&fl=name,id,score
http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&fl=*,score
http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=price
desc&fl=name,id,price
http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&wt=json
--------------------------------------------------------------------------------
------------------------------------------------------
Sorting
=======
http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=price
desc
http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=price asc
http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=inStock
asc, price desc
http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=score
desc
http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=inStock
asc, score desc
http://localhost:8983/solr/#/techproducts/query?
indent=on&q=video&sort=div(popularity,add(price,1)) desc
--------------------------------------------------------------------------------
------------------------------------------------------
Highlighting
============
http://localhost:8983/solr/#/techproducts/query?
indent=on&q=video+card&fl=name,id&hl=true&hl.fl=name,features
--------------------------------------------------------------------------------
------------------------------------------------------
Faceted Search
==============
http://localhost:8983/solr/#/techproducts/query?
indent=on&q=*:*&fl=name&facet=true&facet.field=cat
http://localhost:8983/solr/#/techproducts/query?
indent=on&q=*:*&fl=name&facet=true&facet.field=cat&facet.field=inStock
http://localhost:8983/solr/#/techproducts/query?
indent=on&q=ipod&fl=name&facet=true&facet.query=price:
[0+TO+100]&facet.query=price:[100+TO+*]
http://localhost:8983/solr/#/techproducts/query?
indent=on&q=*:*&fl=name,manufacturedate_dt&facet=true&facet.date=manufacturedate
_dt&facet.date.start=2004-01-01T00:00:00Z&facet.date.end=2010-01-
01T00:00:00Z&facet.date.gap=%2b1YEAR

More Related Content

What's hot

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLJim Mlodgenski
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 TuningPostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 TuningMark Wong
 
Tibero sql execution plan guide en
Tibero sql execution plan guide enTibero sql execution plan guide en
Tibero sql execution plan guide enssusered8afe
 
Linea de comandos bioface zem800
Linea de comandos bioface zem800Linea de comandos bioface zem800
Linea de comandos bioface zem800thomaswarnerherrera
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instanceMonowar Mukul
 
PostgreSQL Procedural Languages: Tips, Tricks and Gotchas
PostgreSQL Procedural Languages: Tips, Tricks and GotchasPostgreSQL Procedural Languages: Tips, Tricks and Gotchas
PostgreSQL Procedural Languages: Tips, Tricks and GotchasJim Mlodgenski
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스PgDay.Seoul
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed FilesAnar Godjaev
 
Oracle postgre sql-mirgration-top-10-mistakes
Oracle postgre sql-mirgration-top-10-mistakesOracle postgre sql-mirgration-top-10-mistakes
Oracle postgre sql-mirgration-top-10-mistakesJim Mlodgenski
 
Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7I Goo Lee
 
How to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdbHow to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdbMarco Vigelini
 
11 Things About 11gr2
11 Things About 11gr211 Things About 11gr2
11 Things About 11gr2afa reg
 
Scripts related to temp tablespace
Scripts related to temp tablespaceScripts related to temp tablespace
Scripts related to temp tablespaceSoumya Das
 
XPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, Citrix
XPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, CitrixXPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, Citrix
XPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, CitrixThe Linux Foundation
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 HowtoPostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 HowtoMark Wong
 

What's hot (20)

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 TuningPostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
 
Command
CommandCommand
Command
 
Tibero sql execution plan guide en
Tibero sql execution plan guide enTibero sql execution plan guide en
Tibero sql execution plan guide en
 
Linea de comandos bioface zem800
Linea de comandos bioface zem800Linea de comandos bioface zem800
Linea de comandos bioface zem800
 
Hadoop Performance comparison
Hadoop Performance comparisonHadoop Performance comparison
Hadoop Performance comparison
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instance
 
Free toolsinstall
Free toolsinstallFree toolsinstall
Free toolsinstall
 
PostgreSQL Procedural Languages: Tips, Tricks and Gotchas
PostgreSQL Procedural Languages: Tips, Tricks and GotchasPostgreSQL Procedural Languages: Tips, Tricks and Gotchas
PostgreSQL Procedural Languages: Tips, Tricks and Gotchas
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed Files
 
Oracle postgre sql-mirgration-top-10-mistakes
Oracle postgre sql-mirgration-top-10-mistakesOracle postgre sql-mirgration-top-10-mistakes
Oracle postgre sql-mirgration-top-10-mistakes
 
Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7
 
How to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdbHow to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdb
 
11 Things About 11gr2
11 Things About 11gr211 Things About 11gr2
11 Things About 11gr2
 
Scripts related to temp tablespace
Scripts related to temp tablespaceScripts related to temp tablespace
Scripts related to temp tablespace
 
XPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, Citrix
XPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, CitrixXPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, Citrix
XPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, Citrix
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 HowtoPostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 Howto
 

Viewers also liked

Untitled Infographic
Untitled InfographicUntitled Infographic
Untitled Infographickatiedingess
 
Nuevo ecosistema digital de la ATTG
Nuevo ecosistema digital de la ATTGNuevo ecosistema digital de la ATTG
Nuevo ecosistema digital de la ATTGATTG Gipuzkoa
 
The Top Attractions in Denver
The Top Attractions in DenverThe Top Attractions in Denver
The Top Attractions in Denver49ThingstoDo
 
Grace Century - About Us
Grace Century - About UsGrace Century - About Us
Grace Century - About UsScott Wolf
 
قطاع الشمال ( بني مزار مغاغة - العدوة )
قطاع الشمال ( بني مزار  مغاغة - العدوة )قطاع الشمال ( بني مزار  مغاغة - العدوة )
قطاع الشمال ( بني مزار مغاغة - العدوة )Nour Elbader
 
bảng giá thiết kế video quảng cáo độc đáo
bảng giá thiết kế video quảng cáo độc đáobảng giá thiết kế video quảng cáo độc đáo
bảng giá thiết kế video quảng cáo độc đáomercedez164
 
Perintah-perintah MS-DOS
Perintah-perintah MS-DOSPerintah-perintah MS-DOS
Perintah-perintah MS-DOSsfhsjd
 

Viewers also liked (10)

Big data
Big dataBig data
Big data
 
Untitled Infographic
Untitled InfographicUntitled Infographic
Untitled Infographic
 
2558 project
2558 project 2558 project
2558 project
 
Nuevo ecosistema digital de la ATTG
Nuevo ecosistema digital de la ATTGNuevo ecosistema digital de la ATTG
Nuevo ecosistema digital de la ATTG
 
Climantica
ClimanticaClimantica
Climantica
 
The Top Attractions in Denver
The Top Attractions in DenverThe Top Attractions in Denver
The Top Attractions in Denver
 
Grace Century - About Us
Grace Century - About UsGrace Century - About Us
Grace Century - About Us
 
قطاع الشمال ( بني مزار مغاغة - العدوة )
قطاع الشمال ( بني مزار  مغاغة - العدوة )قطاع الشمال ( بني مزار  مغاغة - العدوة )
قطاع الشمال ( بني مزار مغاغة - العدوة )
 
bảng giá thiết kế video quảng cáo độc đáo
bảng giá thiết kế video quảng cáo độc đáobảng giá thiết kế video quảng cáo độc đáo
bảng giá thiết kế video quảng cáo độc đáo
 
Perintah-perintah MS-DOS
Perintah-perintah MS-DOSPerintah-perintah MS-DOS
Perintah-perintah MS-DOS
 

Similar to Quick reference for solr

Redo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12cRedo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12cDebasish Nayak
 
Dataguard physical stand by setup
Dataguard physical stand by setupDataguard physical stand by setup
Dataguard physical stand by setupsmajeed1
 
EvolveExecutionPlans.pdf
EvolveExecutionPlans.pdfEvolveExecutionPlans.pdf
EvolveExecutionPlans.pdfPraveenPolu1
 
Basic Knowledge on MySql Replication
Basic Knowledge on MySql ReplicationBasic Knowledge on MySql Replication
Basic Knowledge on MySql ReplicationTasawr Interactive
 
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobsMonowar Mukul
 
glance replicator
glance replicatorglance replicator
glance replicatoririx_jp
 
Moving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASMMoving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASMMonowar Mukul
 
br_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docbr_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docLucky Ally
 

Similar to Quick reference for solr (20)

ZFINDALLZPROGAM
ZFINDALLZPROGAMZFINDALLZPROGAM
ZFINDALLZPROGAM
 
Redo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12cRedo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12c
 
Hadoop on aws amazon
Hadoop on aws amazonHadoop on aws amazon
Hadoop on aws amazon
 
Hadoop on aws amazon
Hadoop on aws amazonHadoop on aws amazon
Hadoop on aws amazon
 
Dataguard physical stand by setup
Dataguard physical stand by setupDataguard physical stand by setup
Dataguard physical stand by setup
 
Ass OS
Ass OSAss OS
Ass OS
 
Ass hđh
Ass hđhAss hđh
Ass hđh
 
Quick reference for curl
Quick reference for curlQuick reference for curl
Quick reference for curl
 
Quick reference for spark sql
Quick reference for spark sqlQuick reference for spark sql
Quick reference for spark sql
 
EvolveExecutionPlans.pdf
EvolveExecutionPlans.pdfEvolveExecutionPlans.pdf
EvolveExecutionPlans.pdf
 
Basic Knowledge on MySql Replication
Basic Knowledge on MySql ReplicationBasic Knowledge on MySql Replication
Basic Knowledge on MySql Replication
 
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
 
Rmoug ashmaster
Rmoug ashmasterRmoug ashmaster
Rmoug ashmaster
 
glance replicator
glance replicatorglance replicator
glance replicator
 
Hadoop course content
Hadoop course contentHadoop course content
Hadoop course content
 
HADOOP Training
HADOOP TrainingHADOOP Training
HADOOP Training
 
Moving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASMMoving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASM
 
br_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docbr_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.doc
 
Less04_Database_Instance.ppt
Less04_Database_Instance.pptLess04_Database_Instance.ppt
Less04_Database_Instance.ppt
 
Awr doag
Awr doagAwr doag
Awr doag
 

Recently uploaded

How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 

Recently uploaded (20)

How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 

Quick reference for solr

  • 1. To start solr ============= C:Program Filessolr-5.4.0bin> solr start -f C:Program Filessolr-5.4.0bin> solr start -f -p 8983 Note: start the service as a foreground process using -f, otherwise restart will not work with background process -------------------------------------------------------------------------------- ------------------------------------------------------ To stop solr ============ C:Program Filessolr-5.4.0bin> solr stop -f -p 8983 C:Program Filessolr-5.4.0bin> solr stop -f -all -------------------------------------------------------------------------------- ------------------------------------------------------ To restart solr =============== C:Program Filessolr-5.4.0bin> solr restart -f -p 8983 -------------------------------------------------------------------------------- ------------------------------------------------------ To validate solr ================ http://localhost:8983/solr/ ******************************************************************************** ****************************************************** Configuration ******************************************************************************** ****************************************************** Creating a Core =============== C:Program Filessolr-5.4.0bin> solr create -c csvcore -d basic_configs -p 8983 C:Program Filessolr-5.4.0bin> solr create -c jsoncore -d basic_configs -p 8983 C:Program Filessolr-5.4.0bin> solr create -c xmlcore -d basic_configs -p 8983 Deleting a Core =============== C:Program Filessolr-5.4.0bin> solr delete -c csvcore -p 8983 C:Program Filessolr-5.4.0bin> solr delete -c jsoncore -p 8983 C:Program Filessolr-5.4.0bin> solr delete -c xmlcore -p 8983 Explanation ----------- -c <name> - Name of the core or collection to create (required). -d <confdir> - The configuration directory, useful in the SolrCloud mode. -n <configName> - The configuration name. This defaults to the same name as the core or collection. -p <port> - Port of a local Solr instance to send the create command to; by default the script tries to detect the port by looking for running Solr instances. -s <shards> - Number of shards to split a collection into, default is 1. -rf <replicas> - Number of copies of each document in the collection. The default is 1. -------------------------------------------------------------------------------- ------------------------------------------------------ Modify the schema.xml file ========================== For CSV data - C:Program Filessolr-5.4.0serversolrcsvcoreconfschema.xml ------------ <uniqueKey>id</uniqueKey> <!-- Fields added for books.csv load--> <field name="cat" type="text_general" indexed="true"
  • 2. stored="true"/> <field name="name" type="text_general" indexed="true" stored="true"/> <field name="price" type="tdouble" indexed="true" stored="true"/> <field name="inStock" type="boolean" indexed="true" stored="true"/> <field name="author" type="text_general" indexed="true" stored="true"/> For JSON data - C:Program Filessolr-5.4.0serversolrjsoncoreconfschema.xml ------------- <uniqueKey>id</uniqueKey> <!-- Added for Multi value example --> <field name="name" type="text_general" indexed="true" stored="true"/> <field name="cat" type="text_general" indexed="true" stored="true" multiValued="true"/> <field name="price" type="tdouble" indexed="true" stored="true"/> <field name="inStock" type="boolean" indexed="true" stored="true"/> <field name="author" type="text_general" indexed="true" stored="true"/> For XML data ------------ Since the default data format is xml, schema definition is not necessary Explanation ----------- name: Name of the field required type: Field type required indexed: Should this field be added to the inverted index? optional stored: Should the original value of this field be stored? optional multiValued: Can this field have multiple values? optional Restart solr to reflect the changes ----------------------------------- C:Program Filessolr-5.4.0bin> solr restart -f -p 8983 -------------------------------------------------------------------------------- ------------------------------------------------------ Indexing the Data ================= C:Program Filessolr-5.4.0exampleexampledocs> java -Dtype=text/csv -Durl=http://localhost:8983/solr/csvcore/update -jar post.jar books.csv C:Program Filessolr-5.4.0exampleexampledocs> java -Dtype=text/json -Durl=http://localhost:8983/solr/jsoncore/update -jar post.jar books.json C:Program Filessolr-5.4.0exampleexampledocs> java -Dtype=text/xml -Durl=http://localhost:8983/solr/xmlcore/update -jar post.jar *.xml Explanation ----------- -Dtype -> the type of the data file. JSON file: text/json, application/json XML files: text/xml, application/xml CSV file: text/csv, application/csv -Durl -> URL for the core. ******************************************************************************** ****************************************************** Access the Indexed documents ********************************************************************************
  • 3. ****************************************************** C:Program Filessolr-5.4.0bin> solr -e techproducts -f -p 8983 Querying Data ============= http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&fl=name,id http://localhost:8983/solr/#/techproducts/query? indent=on&q=video&fl=name,id,score http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&fl=*,score http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=price desc&fl=name,id,price http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&wt=json -------------------------------------------------------------------------------- ------------------------------------------------------ Sorting ======= http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=price desc http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=price asc http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=inStock asc, price desc http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=score desc http://localhost:8983/solr/#/techproducts/query?indent=on&q=video&sort=inStock asc, score desc http://localhost:8983/solr/#/techproducts/query? indent=on&q=video&sort=div(popularity,add(price,1)) desc -------------------------------------------------------------------------------- ------------------------------------------------------ Highlighting ============ http://localhost:8983/solr/#/techproducts/query? indent=on&q=video+card&fl=name,id&hl=true&hl.fl=name,features -------------------------------------------------------------------------------- ------------------------------------------------------ Faceted Search ============== http://localhost:8983/solr/#/techproducts/query? indent=on&q=*:*&fl=name&facet=true&facet.field=cat http://localhost:8983/solr/#/techproducts/query? indent=on&q=*:*&fl=name&facet=true&facet.field=cat&facet.field=inStock http://localhost:8983/solr/#/techproducts/query? indent=on&q=ipod&fl=name&facet=true&facet.query=price: [0+TO+100]&facet.query=price:[100+TO+*] http://localhost:8983/solr/#/techproducts/query? indent=on&q=*:*&fl=name,manufacturedate_dt&facet=true&facet.date=manufacturedate _dt&facet.date.start=2004-01-01T00:00:00Z&facet.date.end=2010-01- 01T00:00:00Z&facet.date.gap=%2b1YEAR