SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

Untitled Infographic
Untitled InfographicUntitled Infographic
Untitled Infographickatiedingess
 
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
 

Destacado (9)

Big data
Big dataBig data
Big data
 
Untitled Infographic
Untitled InfographicUntitled Infographic
Untitled Infographic
 
2558 project
2558 project 2558 project
2558 project
 
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 a 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 a 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 Training
HADOOP TrainingHADOOP Training
HADOOP Training
 
Hadoop course content
Hadoop course contentHadoop course content
Hadoop course content
 
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
 

Último

Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 

Último (20)

Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 

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