SlideShare ist ein Scribd-Unternehmen logo
1 von 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"));
}

Weitere ähnliche Inhalte

Was ist angesagt?

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 - NoIISBilal Haidar
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0Ido Flatow
 
Developing SOAP Web Services using Java
Developing SOAP Web Services using JavaDeveloping SOAP Web Services using Java
Developing SOAP Web Services using Javakrishnaviswambharan
 
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 SwiftWan Muzaffar Wan Hashim
 
Basic architecture
Basic architectureBasic architecture
Basic architecturerasikow
 
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 AppNathalie Steinmetz
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravelConfiz
 
IIS interview questions and answers
IIS interview questions and answersIIS interview questions and answers
IIS interview questions and answersInterviewwiz
 
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 MQGaurav Talwadker
 
Web Server - Internet Applications
Web Server - Internet ApplicationsWeb Server - Internet Applications
Web Server - Internet Applicationssandra sukarieh
 
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 DEVELOPMENTDr. Awase Khirni Syed
 
Implementing portlets using Web Scripts
Implementing portlets using Web ScriptsImplementing portlets using Web Scripts
Implementing portlets using Web ScriptsPiergiorgio Lucidi
 
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 BankPiergiorgio Lucidi
 
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 KohanaArafat Rahman
 
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 ProgrammersSummation IT
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel frameworkAhmad Fatoni
 
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.10Anshum Gupta
 
ColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionSaravanaMuthu Jayaraj
 

Was ist angesagt? (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
 

Andere mochten auch

PROA 03/07 Обеспечение сохранности документов в базах данных
PROA 03/07 Обеспечение сохранности документов в базах данныхPROA 03/07 Обеспечение сохранности документов в базах данных
PROA 03/07 Обеспечение сохранности документов в базах данныхNatasha Khramtsovsky
 
Анализ международного законодательства и правого опыта использования открытых...
Анализ международного законодательства и правого опыта использования открытых...Анализ международного законодательства и правого опыта использования открытых...
Анализ международного законодательства и правого опыта использования открытых...Natasha Khramtsovsky
 
[SPRINTER] Elasticsearch starter-guide for Developer
[SPRINTER] Elasticsearch starter-guide for Developer[SPRINTER] Elasticsearch starter-guide for Developer
[SPRINTER] Elasticsearch starter-guide for DeveloperSomkiat Puisungnoen
 
Что происходило в отрасли в 2014 году: Достижения и планы на будущее
Что происходило в отрасли в 2014 году: Достижения и планы на будущееЧто происходило в отрасли в 2014 году: Достижения и планы на будущее
Что происходило в отрасли в 2014 году: Достижения и планы на будущееNatasha Khramtsovsky
 
Практика разрешения судебных споров, связанных с персональными данными
Практика разрешения судебных споров, связанных с персональными даннымиПрактика разрешения судебных споров, связанных с персональными данными
Практика разрешения судебных споров, связанных с персональными даннымиNatasha Khramtsovsky
 
Flipbook Steve Jasa Dd07081
Flipbook Steve Jasa Dd07081Flipbook Steve Jasa Dd07081
Flipbook Steve Jasa Dd07081jaspang
 
Достоинства и недостатки использования единого сервиса идентификации и аутент...
Достоинства и недостатки использования единого сервиса идентификации и аутент...Достоинства и недостатки использования единого сервиса идентификации и аутент...
Достоинства и недостатки использования единого сервиса идентификации и аутент...Natasha Khramtsovsky
 
PROEXPOSURE Training courses
PROEXPOSURE Training coursesPROEXPOSURE Training courses
PROEXPOSURE Training coursesPROEXPOSURE CIC
 
Нормативная база электронного документооборота госорганов – какой она должна ...
Нормативная база электронного документооборота госорганов – какой она должна ...Нормативная база электронного документооборота госорганов – какой она должна ...
Нормативная база электронного документооборота госорганов – какой она должна ...Natasha Khramtsovsky
 
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 BeMarcus Banks
 
Современные идеи и опыт в области государственного управления: Межведомственн...
Современные идеи и опыт в области государственного управления: Межведомственн...Современные идеи и опыт в области государственного управления: Межведомственн...
Современные идеи и опыт в области государственного управления: Межведомственн...Natasha Khramtsovsky
 

Andere mochten auch (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
 

Ähnlich wie Introduction Apache solr 4.4

Introduction to Apache Solr5
Introduction to Apache Solr5Introduction to Apache Solr5
Introduction to Apache Solr5Phoebe Shih
 
Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes WorkshopErik Hatcher
 
Apache Solr + ajax solr
Apache Solr + ajax solrApache Solr + ajax solr
Apache Solr + ajax solrNet7
 
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 StormP. Taylor Goetz
 
Solr Powered Lucene
Solr Powered LuceneSolr Powered Lucene
Solr Powered LuceneErik Hatcher
 
Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development TutorialErik Hatcher
 
Java-Web-Applications.pdf
Java-Web-Applications.pdfJava-Web-Applications.pdf
Java-Web-Applications.pdfssuserf2dc4c1
 
Intro To Alfresco Part 1
Intro To Alfresco Part 1Intro To Alfresco Part 1
Intro To Alfresco Part 1Jeff Potts
 
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 platformAlfresco Software
 
Bee con2016 presentation_20160125004_installing
Bee con2016 presentation_20160125004_installingBee con2016 presentation_20160125004_installing
Bee con2016 presentation_20160125004_installingAngel Borroy López
 
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)Oksana Kurysheva
 

Ähnlich wie 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)
 

Mehr von 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
 

Kürzlich hochgeladen

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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...Martijn de Jong
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Kürzlich hochgeladen (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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")); }