SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
#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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Plus 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
 

Plus 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
 

Dernier

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
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
[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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
🐬 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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Dernier (20)

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
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

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