Apache Solr
@somkiat
Apache Solr
Search server
Based on Lucene
Full-text search library
Java 100%
Open source
Apache Solr
REST API
HTTP
XML
JSON
Apache Solr
Client supports
.NET
Java
PHP
Ruby
Python
How we
implement ?
SELECT *
FROM product
WHERE id LIKE ‘%1%’
AND name LIKE ‘%xxx%’
Problems
Full table scan = Killer performance
RDBMS is not designed for search
like that
Architecture
Query
WEB
Application

Apache
Solr

Result

Update
Indexer
How to use ?
Install
Define solrconfig.xml
Define schema.xml
Deploy to Java Web Server
Jetty ( Default )
Apache Tomcat
Define schema.xml
Structure of data
Liked table structure
Must have Primary/Unique key
Must have _version_ field
<field name="id" type="string"
indexed="true" stored="true"
required="true" />
!

<field name="item_id" type="string"
inde...
Solr Administrator
http:/
/localhost:8983/solr
Dashboard page
Add/Update index
Add/Update Index
http:/
/localhost:8983/solr/
collection1/update?wt=json
Delete Index

http:/
/localhost:8983/solr/collection1/
update?
stream.body=<delete><query>*:*</
query></delete>&commit=tru...
Ping

http:/
/localhost:8983/solr/
collection1/admin/ping?wt=json
Scaling Solr
Scale up
CPU, RAM, SSD

Scale horizontal
(http:/
/wiki.apache.org/solr/DistributedSearch)

Scale deep
Shardin...
Performance Tools
JMeter
SolrMeter
https:/
/code.google.com/p/
solrmeter/

http:/
/wiki.apache.org/solr/BenchmarkingSolr
JMeter
SolrMeter
Tuning
performance

http:/
/wiki.apache.org/solr/SolrPerformanceFactors
JVM Memory
-Xms1024M -Xmx1024M -server
Virtual Memory
Virtual memory for index
Config in solrconfig.xml
<directoryFactory/>
change from
StandardDirectoryFactory ...
Enable http caching
Config in solrconfig.xml
<httpCaching

lastModifiedFrom="openTime"

etagSeed="Solr" 

never304="false">




<cacheControl>

max-age=43200, must-reva...
Q/A
เกี่ยวกับ Apache solr 4.0
Upcoming SlideShare
Loading in...5
×

เกี่ยวกับ Apache solr 4.0

903

Published on

1. แนะนะเกี่ยวกับ Apache Solr 4.0
2. การใช้งาน Admin
3. การ Scale ระบบงาน
4. เครื่องมือการทดสอบประสิทธิภาพ
5. การ tunning ขั้นพื้นฐาน

Published in: Technology, Education
2 Comments
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
903
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
40
Comments
2
Likes
2
Embeds 0
No embeds

No notes for slide

เกี่ยวกับ Apache solr 4.0

  1. 1. Apache Solr @somkiat
  2. 2. Apache Solr Search server Based on Lucene Full-text search library Java 100% Open source
  3. 3. Apache Solr REST API HTTP XML JSON
  4. 4. Apache Solr Client supports .NET Java PHP Ruby Python
  5. 5. How we implement ?
  6. 6. SELECT * FROM product WHERE id LIKE ‘%1%’ AND name LIKE ‘%xxx%’
  7. 7. Problems Full table scan = Killer performance RDBMS is not designed for search like that
  8. 8. Architecture Query WEB Application Apache Solr Result Update Indexer
  9. 9. How to use ? Install Define solrconfig.xml Define schema.xml Deploy to Java Web Server Jetty ( Default ) Apache Tomcat
  10. 10. Define schema.xml Structure of data Liked table structure Must have Primary/Unique key Must have _version_ field
  11. 11. <field name="id" type="string" indexed="true" stored="true" required="true" /> ! <field name="item_id" type="string" indexed="true" stored="true" required="true" /> <uniqueKey>id</uniqueKey>
  12. 12. Solr Administrator http:/ /localhost:8983/solr
  13. 13. Dashboard page
  14. 14. Add/Update index
  15. 15. Add/Update Index http:/ /localhost:8983/solr/ collection1/update?wt=json
  16. 16. Delete Index http:/ /localhost:8983/solr/collection1/ update? stream.body=<delete><query>*:*</ query></delete>&commit=true
  17. 17. Ping http:/ /localhost:8983/solr/ collection1/admin/ping?wt=json
  18. 18. Scaling Solr Scale up CPU, RAM, SSD Scale horizontal (http:/ /wiki.apache.org/solr/DistributedSearch) Scale deep Sharding and Multiple replicate
  19. 19. Performance Tools JMeter SolrMeter https:/ /code.google.com/p/ solrmeter/ http:/ /wiki.apache.org/solr/BenchmarkingSolr
  20. 20. JMeter
  21. 21. SolrMeter
  22. 22. Tuning performance http:/ /wiki.apache.org/solr/SolrPerformanceFactors
  23. 23. JVM Memory -Xms1024M -Xmx1024M -server
  24. 24. Virtual Memory Virtual memory for index Config in solrconfig.xml <directoryFactory/> change from StandardDirectoryFactory to MmapDirectoryFactory
  25. 25. Enable http caching Config in solrconfig.xml
  26. 26. <httpCaching lastModifiedFrom="openTime" etagSeed="Solr" never304="false"> <cacheControl> max-age=43200, must-revalidate </cacheControl> ! </httpCaching>
  27. 27. Q/A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×