Fork me on GitHub

Solr server for Lutece

Introduction

This plugin embeds SolR server in Lutece portal. The goal is to expose SolR read only for everyone and read/write for lutece portal administrators.

This plugin can be use with module-solrserver-directory

Solr will be accessible at http://lutece-portal-uri/solr/

Request solR on this URI http://lutece-portal-uri/solr/select/?q=id:*

Post content in solR on this URI http://lutece-portal-uri/solr/update/...
You need to be authentify as a Lutece admin to be able to access /solr/update

Index CSV files

One can index CSV files in solR embeded in Lutece portal from the backoffice

The CSV file must be format like :

id,field1_t,field2_i,field3_t,...
dataset_1,toto,521,tutu,...
dataset_2,tata,521,titi,...
...
                        
The column names are important.
You need to have a "id" column to identify a document in SolR.
Column suffix can be "_t" for text content and "_i" for integer content.

Links

Visit SolrQuerySyntax to learn how to request solR

Javascript

It's possible to request SolR throw javascript :
jQuery.ajax({
    url: "/solr/select?q=*:*&facet=true&facet.field=EX1&rows=0&wt=json&indent=on",
    success: function(data){
        $('<div/>').text(data.response.numFound).appendTo("#contenu");
        $.each(data.facet_counts.facet_fields.EX1, function(i,EX1){
        $('<span/>').text(EX1).appendTo("#contenu");
    });
},
dataType: 'jsonp',
jsonp: 'json.wrf'
});