SlideShare uma empresa Scribd logo
1 de 17
Introduction to Apache Solr 4.4
@somkiat
Features
• Full Text Search
• Optimize for high volume web traffic
• Support XML, JSON
• Near Real time indexing
• Admin interface
• Support JMX
• XML configuration
• Extensible with plugin
Download
• Download Apache Solr 4.4 from
http://lucene.apache.org/solr/
Install on Apache Tomcat
• Using /example/webapps/solr.war
Create app1.xml
• In %CATALINA_HOME%confCatalinalocalhost
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase=“c:solr-4.4.0
examplewebappssolr.war" debug="0"
crossContext="true" >
<Environment name="solr/home" type="java.lang.String"
value="c:app11" override="true" />
</Context>
Structure of c:app1
• Copy all files and folder from
Start Tomcat
** Need SLF4J **
• http://www.slf4j.org
• Copy all jar files from … to %CATALINA_HOME/libs
Restart Tomcat
Goto http://localhost:8080/app1
Edit schema.xml
Solr Admin
Solr Client
• http://wiki.apache.org/solr/IntegratingSolr
• Java
– http://wiki.apache.org/solr/Solrj
Demo
$git clone https://github.com/up1/solr_4_demo.git
Indexing Data
String url = "http://localhost:8080/app1/collection1";
SolrServer server = new HttpSolrServer(url);
SolrInputDocument doc1 = new SolrInputDocument();
doc1.addField("id", "1", 1.0f);
doc1.addField("name", "doc 1", 1.0f);
doc1.addField("price", 10);
SolrInputDocument doc2 = new SolrInputDocument();
doc2.addField("id", "2", 1.0f);
doc2.addField("name", "doc 2", 1.0f);
doc2.addField("price", 100);
Collection<SolrInputDocument> docs = new ArrayList<SolrInputDocument>();
docs.add(doc1);
docs.add(doc2);
server.add(docs);
server.commit();
Indexing Data with Bean
String url = "http://localhost:8080/app1/collection1";
SolrServer server = new HttpSolrServer(url);
Product product1 = new Product("1", "product 1", 100f);
Product product2 = new Product("2", "product 2", 200f);
List<Product> products = new ArrayList<Product>();
products.add(product1);
products.add(product2);
server.addBeans(products);
server.commit();
Delete Data
String url = "http://localhost:8080/app1/collection1";
SolrServer server = new HttpSolrServer(url);
server.deleteByQuery("*:*");
server.commit();
Query Data
String url = "http://localhost:8080/app1/collection1";
SolrServer server = new HttpSolrServer(url);
SolrQuery query = new SolrQuery();
query.setQuery("*:*");
query.addSort("price", SolrQuery.ORDER.asc);
QueryResponse rsp = server.query(query);
SolrDocumentList docs = rsp.getResults();
for (SolrDocument solrDocument : docs) {
System.out.print("ID:" + solrDocument.getFieldValue("id"));
System.out.print(", Name:" + solrDocument.getFieldValue("name"));
System.out.println(", Price:" + solrDocument.getFieldValue("price"));
}

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

OWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIISOWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIIS
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
Developing SOAP Web Services using Java
Developing SOAP Web Services using JavaDeveloping SOAP Web Services using Java
Developing SOAP Web Services using Java
 
Cocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftCocoapods and Most common used library in Swift
Cocoapods and Most common used library in Swift
 
Basic architecture
Basic architectureBasic architecture
Basic architecture
 
Request-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails AppRequest-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails App
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravel
 
IIS interview questions and answers
IIS interview questions and answersIIS interview questions and answers
IIS interview questions and answers
 
Integration Of Mulesoft and Apache Active MQ
Integration Of Mulesoft and Apache Active MQIntegration Of Mulesoft and Apache Active MQ
Integration Of Mulesoft and Apache Active MQ
 
Web Server - Internet Applications
Web Server - Internet ApplicationsWeb Server - Internet Applications
Web Server - Internet Applications
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
 
Implementing portlets using Web Scripts
Implementing portlets using Web ScriptsImplementing portlets using Web Scripts
Implementing portlets using Web Scripts
 
Wordpress multisite
Wordpress multisiteWordpress multisite
Wordpress multisite
 
Alfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European BankAlfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European Bank
 
ASP.NET: Present and future
ASP.NET: Present and futureASP.NET: Present and future
ASP.NET: Present and future
 
Web Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaWeb Application Development using MVC Framework Kohana
Web Application Development using MVC Framework Kohana
 
Hire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel ProgrammersHire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel Programmers
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel framework
 
What's New in Apache Solr 4.10
What's New in Apache Solr 4.10What's New in Apache Solr 4.10
What's New in Apache Solr 4.10
 
ColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introduction
 

Destaque

Практика разрешения судебных споров, связанных с персональными данными
Практика разрешения судебных споров, связанных с персональными даннымиПрактика разрешения судебных споров, связанных с персональными данными
Практика разрешения судебных споров, связанных с персональными данными
Natasha Khramtsovsky
 
Flipbook Steve Jasa Dd07081
Flipbook Steve Jasa Dd07081Flipbook Steve Jasa Dd07081
Flipbook Steve Jasa Dd07081
jaspang
 
PROEXPOSURE Training courses
PROEXPOSURE Training coursesPROEXPOSURE Training courses
PROEXPOSURE Training courses
PROEXPOSURE CIC
 
Нормативная база электронного документооборота госорганов – какой она должна ...
Нормативная база электронного документооборота госорганов – какой она должна ...Нормативная база электронного документооборота госорганов – какой она должна ...
Нормативная база электронного документооборота госорганов – какой она должна ...
Natasha Khramtsovsky
 
Современные идеи и опыт в области государственного управления: Межведомственн...
Современные идеи и опыт в области государственного управления: Межведомственн...Современные идеи и опыт в области государственного управления: Межведомственн...
Современные идеи и опыт в области государственного управления: Межведомственн...
Natasha Khramtsovsky
 

Destaque (20)

Uitburgeren via het leerhuis
Uitburgeren via het leerhuisUitburgeren via het leerhuis
Uitburgeren via het leerhuis
 
Burgerinitiatieven versterken - Emilie Van Daele
Burgerinitiatieven versterken - Emilie Van DaeleBurgerinitiatieven versterken - Emilie Van Daele
Burgerinitiatieven versterken - Emilie Van Daele
 
PROA 03/07 Обеспечение сохранности документов в базах данных
PROA 03/07 Обеспечение сохранности документов в базах данныхPROA 03/07 Обеспечение сохранности документов в базах данных
PROA 03/07 Обеспечение сохранности документов в базах данных
 
Анализ международного законодательства и правого опыта использования открытых...
Анализ международного законодательства и правого опыта использования открытых...Анализ международного законодательства и правого опыта использования открытых...
Анализ международного законодательства и правого опыта использования открытых...
 
VFG ontdooid
VFG ontdooidVFG ontdooid
VFG ontdooid
 
[SPRINTER] Elasticsearch starter-guide for Developer
[SPRINTER] Elasticsearch starter-guide for Developer[SPRINTER] Elasticsearch starter-guide for Developer
[SPRINTER] Elasticsearch starter-guide for Developer
 
Что происходило в отрасли в 2014 году: Достижения и планы на будущее
Что происходило в отрасли в 2014 году: Достижения и планы на будущееЧто происходило в отрасли в 2014 году: Достижения и планы на будущее
Что происходило в отрасли в 2014 году: Достижения и планы на будущее
 
Trias
TriasTrias
Trias
 
Практика разрешения судебных споров, связанных с персональными данными
Практика разрешения судебных споров, связанных с персональными даннымиПрактика разрешения судебных споров, связанных с персональными данными
Практика разрешения судебных споров, связанных с персональными данными
 
Proexposure injera
Proexposure  injeraProexposure  injera
Proexposure injera
 
Tooldag 'Financiële planning'
Tooldag 'Financiële planning'Tooldag 'Financiële planning'
Tooldag 'Financiële planning'
 
Flipbook Steve Jasa Dd07081
Flipbook Steve Jasa Dd07081Flipbook Steve Jasa Dd07081
Flipbook Steve Jasa Dd07081
 
Overheidsbeleid en innoverend werken - Gie Van den Eeckhaut
Overheidsbeleid en innoverend werken - Gie Van den EeckhautOverheidsbeleid en innoverend werken - Gie Van den Eeckhaut
Overheidsbeleid en innoverend werken - Gie Van den Eeckhaut
 
Ontwikkelingen van en in de socialprofitsector
Ontwikkelingen van en in de socialprofitsectorOntwikkelingen van en in de socialprofitsector
Ontwikkelingen van en in de socialprofitsector
 
Достоинства и недостатки использования единого сервиса идентификации и аутент...
Достоинства и недостатки использования единого сервиса идентификации и аутент...Достоинства и недостатки использования единого сервиса идентификации и аутент...
Достоинства и недостатки использования единого сервиса идентификации и аутент...
 
PROEXPOSURE Training courses
PROEXPOSURE Training coursesPROEXPOSURE Training courses
PROEXPOSURE Training courses
 
Нормативная база электронного документооборота госорганов – какой она должна ...
Нормативная база электронного документооборота госорганов – какой она должна ...Нормативная база электронного документооборота госорганов – какой она должна ...
Нормативная база электронного документооборота госорганов – какой она должна ...
 
UCSF Talk -- How to Think, How to Be
UCSF Talk -- How to Think, How to BeUCSF Talk -- How to Think, How to Be
UCSF Talk -- How to Think, How to Be
 
Современные идеи и опыт в области государственного управления: Межведомственн...
Современные идеи и опыт в области государственного управления: Межведомственн...Современные идеи и опыт в области государственного управления: Межведомственн...
Современные идеи и опыт в области государственного управления: Межведомственн...
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 

Semelhante a Introduction Apache solr 4.4

Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes Workshop
Erik Hatcher
 
Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development Tutorial
Erik Hatcher
 

Semelhante a Introduction Apache solr 4.4 (20)

Drupal7 and Apache Solr
Drupal7 and Apache SolrDrupal7 and Apache Solr
Drupal7 and Apache Solr
 
Lect06 tomcat1
Lect06 tomcat1Lect06 tomcat1
Lect06 tomcat1
 
Tomcat server
 Tomcat server Tomcat server
Tomcat server
 
Solr5
Solr5Solr5
Solr5
 
Introduction to Apache Solr5
Introduction to Apache Solr5Introduction to Apache Solr5
Introduction to Apache Solr5
 
Solr Recipes
Solr RecipesSolr Recipes
Solr Recipes
 
Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes Workshop
 
Apache solr liferay
Apache solr liferayApache solr liferay
Apache solr liferay
 
Apache Solr + ajax solr
Apache Solr + ajax solrApache Solr + ajax solr
Apache Solr + ajax solr
 
Past, Present, and Future of Apache Storm
Past, Present, and Future of Apache StormPast, Present, and Future of Apache Storm
Past, Present, and Future of Apache Storm
 
Solr Powered Lucene
Solr Powered LuceneSolr Powered Lucene
Solr Powered Lucene
 
Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development Tutorial
 
Apache Solr
Apache SolrApache Solr
Apache Solr
 
Java-Web-Applications.pdf
Java-Web-Applications.pdfJava-Web-Applications.pdf
Java-Web-Applications.pdf
 
Solr a.b-ab
Solr a.b-abSolr a.b-ab
Solr a.b-ab
 
Intro apache
Intro apacheIntro apache
Intro apache
 
Intro To Alfresco Part 1
Intro To Alfresco Part 1Intro To Alfresco Part 1
Intro To Alfresco Part 1
 
Developer’s intro to the alfresco platform
Developer’s intro to the alfresco platformDeveloper’s intro to the alfresco platform
Developer’s intro to the alfresco platform
 
Bee con2016 presentation_20160125004_installing
Bee con2016 presentation_20160125004_installingBee con2016 presentation_20160125004_installing
Bee con2016 presentation_20160125004_installing
 
What Every New Developer Should Know About Alfresco (Jeff Potts)
What Every New Developer Should Know About Alfresco (Jeff Potts)What Every New Developer Should Know About Alfresco (Jeff Potts)
What Every New Developer Should Know About Alfresco (Jeff Potts)
 

Mais de Somkiat Puisungnoen

Mais de Somkiat Puisungnoen (20)

Next of Java 2022
Next of Java 2022Next of Java 2022
Next of Java 2022
 
Sck spring-reactive
Sck spring-reactiveSck spring-reactive
Sck spring-reactive
 
Part 2 :: Spring Boot testing
Part 2 :: Spring Boot testingPart 2 :: Spring Boot testing
Part 2 :: Spring Boot testing
 
vTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring BootvTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring Boot
 
Lesson learned from React native and Flutter
Lesson learned from React native and FlutterLesson learned from React native and Flutter
Lesson learned from React native and Flutter
 
devops
devops devops
devops
 
Angular :: basic tuning performance
Angular :: basic tuning performanceAngular :: basic tuning performance
Angular :: basic tuning performance
 
Shared code between projects
Shared code between projectsShared code between projects
Shared code between projects
 
Distributed Tracing
Distributed Tracing Distributed Tracing
Distributed Tracing
 
Manage data of service
Manage data of serviceManage data of service
Manage data of service
 
RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2
 
Visual testing
Visual testingVisual testing
Visual testing
 
Cloud Native App
Cloud Native AppCloud Native App
Cloud Native App
 
Wordpress for Newbie
Wordpress for NewbieWordpress for Newbie
Wordpress for Newbie
 
Sck Agile in Real World
Sck Agile in Real WorldSck Agile in Real World
Sck Agile in Real World
 
Clean you code
Clean you codeClean you code
Clean you code
 
SCK Firestore at CNX
SCK Firestore at CNXSCK Firestore at CNX
SCK Firestore at CNX
 
Unhappiness Developer
Unhappiness DeveloperUnhappiness Developer
Unhappiness Developer
 
The Beauty of BAD code
The Beauty of  BAD codeThe Beauty of  BAD code
The Beauty of BAD code
 
React in the right way
React in the right wayReact in the right way
React in the right way
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Introduction Apache solr 4.4

  • 1. Introduction to Apache Solr 4.4 @somkiat
  • 2. Features • Full Text Search • Optimize for high volume web traffic • Support XML, JSON • Near Real time indexing • Admin interface • Support JMX • XML configuration • Extensible with plugin
  • 3. Download • Download Apache Solr 4.4 from http://lucene.apache.org/solr/
  • 4. Install on Apache Tomcat • Using /example/webapps/solr.war
  • 5. Create app1.xml • In %CATALINA_HOME%confCatalinalocalhost <?xml version="1.0" encoding="UTF-8"?> <Context docBase=“c:solr-4.4.0 examplewebappssolr.war" debug="0" crossContext="true" > <Environment name="solr/home" type="java.lang.String" value="c:app11" override="true" /> </Context>
  • 6. Structure of c:app1 • Copy all files and folder from
  • 8. ** Need SLF4J ** • http://www.slf4j.org • Copy all jar files from … to %CATALINA_HOME/libs
  • 12. Solr Client • http://wiki.apache.org/solr/IntegratingSolr • Java – http://wiki.apache.org/solr/Solrj
  • 14. Indexing Data String url = "http://localhost:8080/app1/collection1"; SolrServer server = new HttpSolrServer(url); SolrInputDocument doc1 = new SolrInputDocument(); doc1.addField("id", "1", 1.0f); doc1.addField("name", "doc 1", 1.0f); doc1.addField("price", 10); SolrInputDocument doc2 = new SolrInputDocument(); doc2.addField("id", "2", 1.0f); doc2.addField("name", "doc 2", 1.0f); doc2.addField("price", 100); Collection<SolrInputDocument> docs = new ArrayList<SolrInputDocument>(); docs.add(doc1); docs.add(doc2); server.add(docs); server.commit();
  • 15. Indexing Data with Bean String url = "http://localhost:8080/app1/collection1"; SolrServer server = new HttpSolrServer(url); Product product1 = new Product("1", "product 1", 100f); Product product2 = new Product("2", "product 2", 200f); List<Product> products = new ArrayList<Product>(); products.add(product1); products.add(product2); server.addBeans(products); server.commit();
  • 16. Delete Data String url = "http://localhost:8080/app1/collection1"; SolrServer server = new HttpSolrServer(url); server.deleteByQuery("*:*"); server.commit();
  • 17. Query Data String url = "http://localhost:8080/app1/collection1"; SolrServer server = new HttpSolrServer(url); SolrQuery query = new SolrQuery(); query.setQuery("*:*"); query.addSort("price", SolrQuery.ORDER.asc); QueryResponse rsp = server.query(query); SolrDocumentList docs = rsp.getResults(); for (SolrDocument solrDocument : docs) { System.out.print("ID:" + solrDocument.getFieldValue("id")); System.out.print(", Name:" + solrDocument.getFieldValue("name")); System.out.println(", Price:" + solrDocument.getFieldValue("price")); }