SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
#1




Solr and symfony in Harmony with SolrJs
                Doc. v. 0.1 - 21/04/09




                 Wildan Maulana | wildan [at] tobethink.com
About SolrJs
• SolrJS is a JQuery based ajaxian
  interface to the Solr search engine
• One of the 2008 Google summer of
  code project topic
• Still work in progress but already been
  useable, watch
  http://wiki.apache.org/solr/SolrJS for
  newest info
About SolrJs - Cont


• Written In Object
  Oriented JavaScript
Architectural Overview
    SolrJS → a collection of reusable and extendable “widget”
•
    A widget is a javascript object that is responsible for creating the according
•
    solr query as well as render the result from the server to html
    One manager object acts as a container that holds these widgets, performs
•
    the actual query using jQueries getJSON
    http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback method
    There are two base types of widgets:
•
     – client side widgets: They get a Javascript JSON response from the
       server and render the needed html for the widget using jQuery javascript
       code.
     – server side widgets: They move the rendering logic to the server,
       using the VelocityResponseWriter (see
       https://issues.apache.org/jira/browse/SOLR-620. The widget then only
       quot;copiesquot; the html reponse from the server into the target div.
    The Js files is organized in “packages” like in a Java Application:
•
     – core: The manager and other base classes.
     – server: server side widgets
     – client: client side widgets
The Manager Object
    addSelectionView(widget)
•
    Adds a selection view to this manager.
    addWidget(widget)
•
    Adds a widget to this manager.
    containsItem(item)
•
    Checks if the given item is available in the current selection.
    deselectItem(widgetId)
•
    Removes the given item from the current selection, regardless of widgets.
    deselectItems(widgetId)
•
    Removes the given items from the current selection.
    doRequest(start, resultsOnly)
•
    Creates a query out of the current selection and calls all bound widgets to
    request their data from the server.
     doRequestAll()
•
    Sets the current selection to *:* and requests all docs.
    getLoadingDiv()
•
    Helper method that returns an ajax-loading.gif inside a div.
    selectItems(widgetId, items)
•
    Adds the given items to the current selection.
Example
Document
<REUTERS TOPICS=quot;YESquot; LEWISSPLIT=quot;TRAINquot; CGISPLIT=quot;TRAINING-SETquot; OLDID=quot;5544quot; NEWID=quot;1quot;>
<DATE>26-FEB-1987 15:01:01.79</DATE>
<TOPICS><D>cocoa</D></TOPICS>
<PLACES><D>el-salvador</D><D>usa</D><D>uruguay</D></PLACES>
<PEOPLE></PEOPLE>
<ORGS></ORGS>
<EXCHANGES></EXCHANGES>
<COMPANIES></COMPANIES>
<UNKNOWN>
&#5;&#5;&#5;C T
&#22;&#22;&#1;f0704&#31;reute
u f BC-BAHIA-COCOA-REVIEW 02-26 0105</UNKNOWN>
<TEXT>&#2;
<TITLE>BAHIA COCOA REVIEW</TITLE>
<DATELINE> SALVADOR, Feb 26 - </DATELINE>
<BODY>
content here ........
</BODY>
</TEXT>
</REUTERS>
Response Example on SolrAdmin: Cocoa

<response>                                        <str>SV</str>
<lst name=quot;responseHeaderquot;>                       <str>US</str>
<int name=quot;statusquot;>0</int>                        <str>UY</str>
<int name=quot;QTimequot;>35</int>                        </arr>
<lst name=quot;paramsquot;>                               <date name=quot;datequot;>1987-02-26T08:01:01.079Z</date>
<str name=quot;indentquot;>on</str>                       <str name=quot;datelinequot;>SALVADOR, Feb 26 -</str>
<str name=quot;startquot;>0</str>                         <str name=quot;idquot;>1</str>
<str name=quot;qquot;>cocoa</str>                         <arr name=quot;placesquot;>
<str name=quot;versionquot;>2.2</str>                     <str>el-salvador</str>
<str name=quot;rowsquot;>10</str>                         <str>usa</str>
</lst>                                            <str>uruguay</str>
</lst>                                            </arr>
<result name=quot;responsequot; numFound=quot;1quot; start=quot;0quot;>   <str name=quot;textquot;>
<doc>                                             Content here ...
<arr name=quot;allTextquot;>                              </str>
<str>BAHIA COCOA REVIEW</str>                     <str name=quot;titlequot;>BAHIA COCOA REVIEW</str>
<str>                                             <arr name=quot;topicsquot;>
Content here ...                                  <str>cocoa</str>
</str>                                            </arr>
<str>el-salvador</str>                            </doc>
<str>usa</str>                                    </result>
<str>uruguay</str>                                </response>
<str>cocoa</str>
</arr>
<arr name=quot;countryCodesquot;>
Action and Template
Minimalistic Action

 public function executeJs() {
    return sfView::SUCCESS ;
 }


The Template

<div id=quot;facetsquot; style=quot;float: left; width: 300px;quot;>
<h3 style=quot;margin-top: 0pxquot;>topics</h3>
<div id=quot;topicsquot;></div>
</div>
<div id=quot;resultquot;
     style=quot;margin-left: 300px;quot;></div>
<html>
             <head>
The Layout   ...................
             ..............
             <script>
               var $sj = jQuery.noConflict();
             </script>


                 <script>
                   var solrjsManager;
               $sj(document).ready(function(){
                     solrjsManager = new
             $sj.solrjs.Manager({solrUrl:quot;http://localhost:8983/solr/selectquot;});

               // a custom result widget
                   var resultWidget = new $sj.solrjs.SimpleServerSideWidget({
                            id:quot;resultquot;,
                            target:quot;#resultquot;,
                            rows:5,
                            templateName:quot;resultquot;
                       });

                 solrjsManager.addWidget(resultWidget);
                      solrjsManager.addWidget(new $sj.solrjs.FacetServerSideWidget({id:quot;topicsquot;,
             target:quot;#topicsquot;, fieldName:quot;topicsquot;}));
             solrjsManager.doRequestAll();
             });
             </script>

                 </head>
                 <body>
                   <?php echo $sf_content ?>
                 </body>
                 </html>
result.vm
   #foreach($item in $response.getResults())
    <div>
      <h3> $item.getFieldValue(quot;titlequot;); </h3>
      #if($item.getFieldValue(quot;topicsquot;))
      <p>
       <i> $item.getFieldValue(quot;topicsquot;);</i>
      </p>
      #end
      <p>
       $item.getFieldValue(quot;textquot;);
      </p>
    </div>
    <hr/>
   #end
facets.vm

#foreach($item in $response.getFacetFields())
 <div>
   #foreach($count in $item.getValues())
    <a href=quot;javascript:solrjsManager.selectItems('$request.getParams()
      .get('solrjs.widgetid')',[new jQuery.solrjs.QueryItem({field:'$count.getFacetField()
      .getName()',value:'$count.getName()'})])quot;>
             $count.getName()($count.getCount()) </a><br/>
   #end
 </div>
#end
References
• SolrJS Wiki,
  http://wiki.apache.org/solr/SolrJS

Mais conteúdo relacionado

Mais procurados

jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginningAnis Ahmad
 
Diagnóstico preliminar sistêmico gestão
Diagnóstico preliminar sistêmico gestãoDiagnóstico preliminar sistêmico gestão
Diagnóstico preliminar sistêmico gestãoPríncipe Simões
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Alessandro Nadalin
 
Significant Characteristics In Planets Manfred Thaller
Significant Characteristics In Planets Manfred ThallerSignificant Characteristics In Planets Manfred Thaller
Significant Characteristics In Planets Manfred ThallerDigitalPreservationEurope
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в MagentoMagecom Ukraine
 
网站无障碍阅读知识
网站无障碍阅读知识网站无障碍阅读知识
网站无障碍阅读知识ppanyong
 
jQuery : Events are where it happens!
jQuery : Events are where it happens!jQuery : Events are where it happens!
jQuery : Events are where it happens!Wildan Maulana
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponentsCyril Balit
 
Html, CSS, Javascript, Jquery, Meteor應用
Html, CSS, Javascript, Jquery, Meteor應用Html, CSS, Javascript, Jquery, Meteor應用
Html, CSS, Javascript, Jquery, Meteor應用LearningTech
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQueryAlan Hecht
 
2012 BRZ wiring service manual
2012 BRZ wiring service manual2012 BRZ wiring service manual
2012 BRZ wiring service manualLeo Kokkat
 

Mais procurados (20)

Usecase
UsecaseUsecase
Usecase
 
7.1. ginecologia y obstetricia
7.1. ginecologia  y obstetricia7.1. ginecologia  y obstetricia
7.1. ginecologia y obstetricia
 
JQuery 101
JQuery 101JQuery 101
JQuery 101
 
Javascript Basic
Javascript BasicJavascript Basic
Javascript Basic
 
Os Nixon
Os NixonOs Nixon
Os Nixon
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
Diagnóstico preliminar sistêmico gestão
Diagnóstico preliminar sistêmico gestãoDiagnóstico preliminar sistêmico gestão
Diagnóstico preliminar sistêmico gestão
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
 
Significant Characteristics In Planets Manfred Thaller
Significant Characteristics In Planets Manfred ThallerSignificant Characteristics In Planets Manfred Thaller
Significant Characteristics In Planets Manfred Thaller
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
 
网站无障碍阅读知识
网站无障碍阅读知识网站无障碍阅读知识
网站无障碍阅读知识
 
Introducing jQuery
Introducing jQueryIntroducing jQuery
Introducing jQuery
 
jQuery : Events are where it happens!
jQuery : Events are where it happens!jQuery : Events are where it happens!
jQuery : Events are where it happens!
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
 
Html, CSS, Javascript, Jquery, Meteor應用
Html, CSS, Javascript, Jquery, Meteor應用Html, CSS, Javascript, Jquery, Meteor應用
Html, CSS, Javascript, Jquery, Meteor應用
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
HTML5 - Pedro Rosa
HTML5 - Pedro RosaHTML5 - Pedro Rosa
HTML5 - Pedro Rosa
 
2012 BRZ wiring service manual
2012 BRZ wiring service manual2012 BRZ wiring service manual
2012 BRZ wiring service manual
 

Destaque

One thousand and one nights
One thousand and one nightsOne thousand and one nights
One thousand and one nightsGIA VER
 
Software Estimation : What is An Estimate ?
Software Estimation : What is An Estimate ?Software Estimation : What is An Estimate ?
Software Estimation : What is An Estimate ?Wildan Maulana
 
2010 Calendar With Frames
2010 Calendar With Frames2010 Calendar With Frames
2010 Calendar With FramesGIA VER
 

Destaque (7)

1
11
1
 
1
11
1
 
One thousand and one nights
One thousand and one nightsOne thousand and one nights
One thousand and one nights
 
Software Estimation : What is An Estimate ?
Software Estimation : What is An Estimate ?Software Estimation : What is An Estimate ?
Software Estimation : What is An Estimate ?
 
2010 Calendar With Frames
2010 Calendar With Frames2010 Calendar With Frames
2010 Calendar With Frames
 
Towards a Complete and Green Cleveland-Neal, 2012
Towards a Complete and Green Cleveland-Neal, 2012Towards a Complete and Green Cleveland-Neal, 2012
Towards a Complete and Green Cleveland-Neal, 2012
 
Suprman
SuprmanSuprman
Suprman
 

Semelhante a Solr and symfony in Harmony with SolrJs

Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone InteractivityEric Steele
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsJohannes Geppert
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On RailsWen-Tien Chang
 
Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and DashboardsAtlassian
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2borkweb
 
JavaServer Faces Anti-Patterns and Pitfalls
JavaServer Faces Anti-Patterns and PitfallsJavaServer Faces Anti-Patterns and Pitfalls
JavaServer Faces Anti-Patterns and PitfallsDennis Byrne
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLseleciii44
 
jQuery Internals + Cool Stuff
jQuery Internals + Cool StuffjQuery Internals + Cool Stuff
jQuery Internals + Cool Stuffjeresig
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2tonvanbart
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Matt Raible
 
Microsoft ASP.NET 4.0 : What's Next?
Microsoft ASP.NET 4.0 : What's Next?Microsoft ASP.NET 4.0 : What's Next?
Microsoft ASP.NET 4.0 : What's Next?goodfriday
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationDavid Calavera
 
User Experience is dead. Long live the user experience!
User Experience is dead. Long live the user experience!User Experience is dead. Long live the user experience!
User Experience is dead. Long live the user experience!Greg Bell
 
CSIS 138 Javascript Class1
CSIS 138 Javascript Class1CSIS 138 Javascript Class1
CSIS 138 Javascript Class1Teresa Pelkie
 

Semelhante a Solr and symfony in Harmony with SolrJs (20)

Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Seam Glassfish Slidecast
Seam Glassfish SlidecastSeam Glassfish Slidecast
Seam Glassfish Slidecast
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
 
Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid Tags
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On Rails
 
Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and Dashboards
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 
JavaServer Faces Anti-Patterns and Pitfalls
JavaServer Faces Anti-Patterns and PitfallsJavaServer Faces Anti-Patterns and Pitfalls
JavaServer Faces Anti-Patterns and Pitfalls
 
Introduction to JQuery
Introduction to JQueryIntroduction to JQuery
Introduction to JQuery
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTL
 
jQuery Internals + Cool Stuff
jQuery Internals + Cool StuffjQuery Internals + Cool Stuff
jQuery Internals + Cool Stuff
 
Ajax ons2
Ajax ons2Ajax ons2
Ajax ons2
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
Microsoft ASP.NET 4.0 : What's Next?
Microsoft ASP.NET 4.0 : What's Next?Microsoft ASP.NET 4.0 : What's Next?
Microsoft ASP.NET 4.0 : What's Next?
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementation
 
User Experience is dead. Long live the user experience!
User Experience is dead. Long live the user experience!User Experience is dead. Long live the user experience!
User Experience is dead. Long live the user experience!
 
CSIS 138 Javascript Class1
CSIS 138 Javascript Class1CSIS 138 Javascript Class1
CSIS 138 Javascript Class1
 

Mais de Wildan Maulana

Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018Wildan Maulana
 
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...Wildan Maulana
 
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam MelonKetahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam MelonWildan Maulana
 
Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014Wildan Maulana
 
ICA – AtoM : Retensi Arsip
ICA – AtoM : Retensi ArsipICA – AtoM : Retensi Arsip
ICA – AtoM : Retensi ArsipWildan Maulana
 
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RWOpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RWWildan Maulana
 
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...Wildan Maulana
 
PostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyToolsPostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyToolsWildan Maulana
 
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...Wildan Maulana
 
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai SpMensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai SpWildan Maulana
 
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity ProviderKonfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity ProviderWildan Maulana
 
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)Wildan Maulana
 
Instalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphpInstalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphpWildan Maulana
 
River Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River RestorationRiver Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River RestorationWildan Maulana
 
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...Wildan Maulana
 
Penilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan DasarPenilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan DasarWildan Maulana
 
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and UsesProyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and UsesWildan Maulana
 
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang TuaOpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang TuaWildan Maulana
 
Menggunakan AlisJK : Equating
Menggunakan AlisJK : EquatingMenggunakan AlisJK : Equating
Menggunakan AlisJK : EquatingWildan Maulana
 

Mais de Wildan Maulana (20)

Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018
 
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
 
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam MelonKetahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
 
Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014
 
ICA – AtoM : Retensi Arsip
ICA – AtoM : Retensi ArsipICA – AtoM : Retensi Arsip
ICA – AtoM : Retensi Arsip
 
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RWOpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
 
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
 
PostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyToolsPostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
 
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...
 
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai SpMensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
 
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity ProviderKonfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity Provider
 
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
 
Instalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphpInstalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphp
 
River Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River RestorationRiver Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River Restoration
 
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
 
Penilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan DasarPenilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan Dasar
 
Statistik Listrik
Statistik ListrikStatistik Listrik
Statistik Listrik
 
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and UsesProyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
 
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang TuaOpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
 
Menggunakan AlisJK : Equating
Menggunakan AlisJK : EquatingMenggunakan AlisJK : Equating
Menggunakan AlisJK : Equating
 

Último

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 Takeoffsammart93
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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.pdfsudhanshuwaghmare1
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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 FMESafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Último (20)

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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Solr and symfony in Harmony with SolrJs

  • 1. #1 Solr and symfony in Harmony with SolrJs Doc. v. 0.1 - 21/04/09 Wildan Maulana | wildan [at] tobethink.com
  • 2. About SolrJs • SolrJS is a JQuery based ajaxian interface to the Solr search engine • One of the 2008 Google summer of code project topic • Still work in progress but already been useable, watch http://wiki.apache.org/solr/SolrJS for newest info
  • 3. About SolrJs - Cont • Written In Object Oriented JavaScript
  • 4. Architectural Overview SolrJS → a collection of reusable and extendable “widget” • A widget is a javascript object that is responsible for creating the according • solr query as well as render the result from the server to html One manager object acts as a container that holds these widgets, performs • the actual query using jQueries getJSON http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback method There are two base types of widgets: • – client side widgets: They get a Javascript JSON response from the server and render the needed html for the widget using jQuery javascript code. – server side widgets: They move the rendering logic to the server, using the VelocityResponseWriter (see https://issues.apache.org/jira/browse/SOLR-620. The widget then only quot;copiesquot; the html reponse from the server into the target div. The Js files is organized in “packages” like in a Java Application: • – core: The manager and other base classes. – server: server side widgets – client: client side widgets
  • 5. The Manager Object addSelectionView(widget) • Adds a selection view to this manager. addWidget(widget) • Adds a widget to this manager. containsItem(item) • Checks if the given item is available in the current selection. deselectItem(widgetId) • Removes the given item from the current selection, regardless of widgets. deselectItems(widgetId) • Removes the given items from the current selection. doRequest(start, resultsOnly) • Creates a query out of the current selection and calls all bound widgets to request their data from the server. doRequestAll() • Sets the current selection to *:* and requests all docs. getLoadingDiv() • Helper method that returns an ajax-loading.gif inside a div. selectItems(widgetId, items) • Adds the given items to the current selection.
  • 7. Document <REUTERS TOPICS=quot;YESquot; LEWISSPLIT=quot;TRAINquot; CGISPLIT=quot;TRAINING-SETquot; OLDID=quot;5544quot; NEWID=quot;1quot;> <DATE>26-FEB-1987 15:01:01.79</DATE> <TOPICS><D>cocoa</D></TOPICS> <PLACES><D>el-salvador</D><D>usa</D><D>uruguay</D></PLACES> <PEOPLE></PEOPLE> <ORGS></ORGS> <EXCHANGES></EXCHANGES> <COMPANIES></COMPANIES> <UNKNOWN> &#5;&#5;&#5;C T &#22;&#22;&#1;f0704&#31;reute u f BC-BAHIA-COCOA-REVIEW 02-26 0105</UNKNOWN> <TEXT>&#2; <TITLE>BAHIA COCOA REVIEW</TITLE> <DATELINE> SALVADOR, Feb 26 - </DATELINE> <BODY> content here ........ </BODY> </TEXT> </REUTERS>
  • 8. Response Example on SolrAdmin: Cocoa <response> <str>SV</str> <lst name=quot;responseHeaderquot;> <str>US</str> <int name=quot;statusquot;>0</int> <str>UY</str> <int name=quot;QTimequot;>35</int> </arr> <lst name=quot;paramsquot;> <date name=quot;datequot;>1987-02-26T08:01:01.079Z</date> <str name=quot;indentquot;>on</str> <str name=quot;datelinequot;>SALVADOR, Feb 26 -</str> <str name=quot;startquot;>0</str> <str name=quot;idquot;>1</str> <str name=quot;qquot;>cocoa</str> <arr name=quot;placesquot;> <str name=quot;versionquot;>2.2</str> <str>el-salvador</str> <str name=quot;rowsquot;>10</str> <str>usa</str> </lst> <str>uruguay</str> </lst> </arr> <result name=quot;responsequot; numFound=quot;1quot; start=quot;0quot;> <str name=quot;textquot;> <doc> Content here ... <arr name=quot;allTextquot;> </str> <str>BAHIA COCOA REVIEW</str> <str name=quot;titlequot;>BAHIA COCOA REVIEW</str> <str> <arr name=quot;topicsquot;> Content here ... <str>cocoa</str> </str> </arr> <str>el-salvador</str> </doc> <str>usa</str> </result> <str>uruguay</str> </response> <str>cocoa</str> </arr> <arr name=quot;countryCodesquot;>
  • 9. Action and Template Minimalistic Action public function executeJs() { return sfView::SUCCESS ; } The Template <div id=quot;facetsquot; style=quot;float: left; width: 300px;quot;> <h3 style=quot;margin-top: 0pxquot;>topics</h3> <div id=quot;topicsquot;></div> </div> <div id=quot;resultquot; style=quot;margin-left: 300px;quot;></div>
  • 10. <html> <head> The Layout ................... .............. <script> var $sj = jQuery.noConflict(); </script> <script> var solrjsManager; $sj(document).ready(function(){ solrjsManager = new $sj.solrjs.Manager({solrUrl:quot;http://localhost:8983/solr/selectquot;}); // a custom result widget var resultWidget = new $sj.solrjs.SimpleServerSideWidget({ id:quot;resultquot;, target:quot;#resultquot;, rows:5, templateName:quot;resultquot; }); solrjsManager.addWidget(resultWidget); solrjsManager.addWidget(new $sj.solrjs.FacetServerSideWidget({id:quot;topicsquot;, target:quot;#topicsquot;, fieldName:quot;topicsquot;})); solrjsManager.doRequestAll(); }); </script> </head> <body> <?php echo $sf_content ?> </body> </html>
  • 11. result.vm #foreach($item in $response.getResults()) <div> <h3> $item.getFieldValue(quot;titlequot;); </h3> #if($item.getFieldValue(quot;topicsquot;)) <p> <i> $item.getFieldValue(quot;topicsquot;);</i> </p> #end <p> $item.getFieldValue(quot;textquot;); </p> </div> <hr/> #end
  • 12. facets.vm #foreach($item in $response.getFacetFields()) <div> #foreach($count in $item.getValues()) <a href=quot;javascript:solrjsManager.selectItems('$request.getParams() .get('solrjs.widgetid')',[new jQuery.solrjs.QueryItem({field:'$count.getFacetField() .getName()',value:'$count.getName()'})])quot;> $count.getName()($count.getCount()) </a><br/> #end </div> #end
  • 13.
  • 14. References • SolrJS Wiki, http://wiki.apache.org/solr/SolrJS