Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SMILA/Documentation/Solr Integration"

(New page: == <tt>org.eclipse.smila.integration.solr.SolrPipelet</tt> == === Description === This pipelet integrates Apache Solr's HTTP REST API ([http://wiki.apache.org/solr/SearchHandler?action=s...)
 
Line 1: Line 1:
== <tt>org.eclipse.smila.integration.solr.SolrPipelet</tt> ==
+
== <tt>org.eclipse.smila.integration.solr.SolrIndexPipelet</tt> ==
  
 
=== Description ===
 
=== Description ===
  
This pipelet integrates Apache Solr's HTTP REST API ([http://wiki.apache.org/solr/SearchHandler?action=show&redirect=StandardRequestHandler http://wiki.apache.org/solr/SearchHandler?action=show&redirect=StandardRequestHandler] and [http://wiki.apache.org/solr/UpdateXmlMessages http://wiki.apache.org/solr/UpdateXmlMessages] ) for utilizing Solr as a distributed index service.
+
This pipelet integrates Apache Solr's HTTP REST API ([http://wiki.apache.org/solr/SearchHandler?action=show&redirect=StandardRequestHandler http://wiki.apache.org/solr/SearchHandler?action=show&redirect=StandardRequestHandler] and [http://wiki.apache.org/solr/UpdateXmlMessages http://wiki.apache.org/solr/UpdateXmlMessages] ) for adding records to resp. deleting records from a Solr index.
Therefore it is now possible to build large volume search applications by basing them on SMILA and deploying Solr for coping with large indices which are not manageable on one node because of their large size which exceeds the limits of the node's file system.
+
Therefore, it is now possible to build large volume search applications by basing them on SMILA and deploying Solr for coping with large indices which are not manageable on one node because of their large size which exceeds the limits of the node's file system.
  
'''Note:''' Currently this pipelet supports Solr 1.4. The integration of features added with the release of Solr 1.5 will be done in near future.
+
'''Note:''' Currently this pipelet supports Solr 1.4. The integration of features added with the release of Solr 1.5 will be accomplished in the near future.
  
 
=== Configuration ===
 
=== Configuration ===
Line 13: Line 13:
 
!Property!!Constraint!!Description
 
!Property!!Constraint!!Description
 
|-
 
|-
|executionMode||optional||the execution mode of the pipelet, default is ADD
+
|''executionMode''||Optional||The execution mode of the pipelet, default is ADD.
 
|-
 
|-
|allowDoublets||optional||the instruction for Solr if doublets are allowed, default is false
+
|''allowDoublets''||Optional||The instruction for Solr if doublets are allowed, default is false.
 
|-
 
|-
|commitWithin||optional||the commit interval for Solr in miliseconds, default is 10000
+
|''commitWithin''||Optional||The commit interval for Solr in miliseconds, default is 10000.
 
|-
 
|-
|indexName||optional||the name of the index/core on which Solr should operate. Currently we do not support more than one index/core.
+
|''indexname''||Optional||The name of the index/core on which Solr should operate. Currently we do not support more than one index/core.
|-
+
|highlight||optional||the highlight flag, default is true
+
|-
+
|highlight.params||optional||all the highlighting parameter passed directly to Solr. For more details please see: [http://wiki.apache.org/solr/HighlightingParameters http://wiki.apache.org/solr/HighlightingParameters]
+
 
|}
 
|}
  
 
==== Example ====
 
==== Example ====
  
'''PipeletConfiguration for SolrPipelet in addpipeline.bpel'''
+
'''Pipelet configuration for SolrIndexPipelet in addpipeline.bpel'''
 
<source lang="xml">
 
<source lang="xml">
<proc:PipeletConfiguration>
+
<extensionActivity>
<proc:Property name="executionMode">
+
  <proc:invokePipelet name="invokeSolrPipelet">
<proc:Value>ADD</proc:Value>
+
    <proc:pipelet class="org.eclipse.smila.integration.solr.SolrIndexPipelet" />
</proc:Property>
+
    <proc:variables input="request" />
<proc:Property name="allowDoublets" type="java.lang.Boolean">
+
    <proc:configuration>
<proc:Value>false</proc:Value>
+
      <rec:Val key="executionMode">ADD</rec:Val>
</proc:Property>
+
      <rec:Val key="allowDoublets" type="boolean">false</rec:Val>
<proc:Property name="commitWithin" type="java.lang.Integer">
+
      <rec:Val key="commitWithin" type="long">10000</rec:Val>
<proc:Value>10000</proc:Value>
+
      <rec:Val key="indexname">test_index</rec:Val>
</proc:Property>
+
    </proc:configuration>
<proc:Property name="indexName">
+
  </proc:invokePipelet>
<proc:Value>test_index</proc:Value>
+
</extensionActivity>
</proc:Property>
+
</proc:PipeletConfiguration>      
+
 
</source>
 
</source>
  
'''PipeletConfiguration for SolrPipelet in searchpipeline.bpel'''
+
== <tt>org.eclipse.smila.integration.solr.SolrSearchPipelet</tt> ==
 +
 
 +
=== Description ===
 +
 
 +
This pipelet integrates Apache Solr's HTTP REST API ([http://wiki.apache.org/solr/SearchHandler?action=show&redirect=StandardRequestHandler http://wiki.apache.org/solr/SearchHandler?action=show&redirect=StandardRequestHandler] and [http://wiki.apache.org/solr/UpdateXmlMessages http://wiki.apache.org/solr/UpdateXmlMessages] ) for searching in a Solr index.
 +
 
 +
'''Note:''' Currently this pipelet supports Solr 1.4. The integration of features added with the release of Solr 1.5 will be accomplished in the near future.
 +
 
 +
=== Configuration ===
 +
 
 +
From the search request, the pipelet uses the standard search parameters ''query'', ''maxcount'', ''offset'', and ''resultAttributes''. In addition to that, the following properties can be set in the pipelet configuration:
 +
 
 +
{| border = 1
 +
!Property!!Constraint!!Description
 +
|-
 +
|''highlight''||Optional||The highlight flag, default is true.
 +
|-
 +
|''highlight.params''||Optional||All highlighting parameters passed directly to Solr. For more details, please see [http://wiki.apache.org/solr/HighlightingParameters http://wiki.apache.org/solr/HighlightingParameters].
 +
|}
 +
 
 +
==== Example ====
 +
 
 +
'''Pipelet configuration for SolrSearchPipelet in searchpipeline.bpel'''
 
<source lang="xml">
 
<source lang="xml">
<proc:PipeletConfiguration>
+
<extensionActivity>
<proc:Property name="shards">
+
  <proc:invokePipelet name="invokeSolrPipelet">
<proc:Value>localhost:8983/solr</proc:Value>
+
    <proc:pipelet class="org.eclipse.smila.integration.solr.SolrSearchPipelet" />
<!-- List here all other nodes that are part of the index cluster -->
+
    <proc:variables input="request" />
</proc:Property>
+
    <proc:configuration>
<proc:Property name="highlight" type="java.lang.Boolean">
+
      <rec:Seq key="shards">
<proc:Value>true</proc:Value>
+
        <rec:Val>localhost:8983/solr</rec:Val>
</proc:Property>
+
      </rec:Seq>
<proc:Property name="highlight.params">
+
      <rec:Val key="highlight" type="boolean">true</rec:Val>
<proc:Value>hl.fl=Content</proc:Value>
+
      <rec:Seq key="highlight.params">
<proc:Value>hl.snippets=3</proc:Value>
+
        <rec:Val>hl.fl=Content</rec:Val>
<proc:Value>hl.simple.pre=&lt;b&gt;</proc:Value>
+
        <rec:Val>hl.snippets=3</rec:Val>
<proc:Value>hl.simple.post=&lt;/b&gt;</proc:Value>
+
        <rec:Val>hl.simple.pre=&lt;b&gt;</rec:Val>
<proc:Value>hl.fragsize=300</proc:Value>
+
        <rec:Val>hl.simple.post=&lt;/b&gt;</rec:Val>
<proc:Value>hl.mergeContiguous=false</proc:Value>
+
        <rec:Val>hl.fragsize=300</rec:Val>
</proc:Property>
+
        <rec:Val>hl.mergeContiguous=false</rec:Val>
</proc:PipeletConfiguration>      
+
      </rec:Seq>
 +
    </proc:configuration>
 +
  </proc:invokePipelet>
 +
</extensionActivity>
 
</source>
 
</source>
  
  
 
[[Category:SMILA]]  [[Category:SMILA/Documentation]]
 
[[Category:SMILA]]  [[Category:SMILA/Documentation]]

Revision as of 10:31, 20 April 2011

org.eclipse.smila.integration.solr.SolrIndexPipelet

Description

This pipelet integrates Apache Solr's HTTP REST API (http://wiki.apache.org/solr/SearchHandler?action=show&redirect=StandardRequestHandler and http://wiki.apache.org/solr/UpdateXmlMessages ) for adding records to resp. deleting records from a Solr index. Therefore, it is now possible to build large volume search applications by basing them on SMILA and deploying Solr for coping with large indices which are not manageable on one node because of their large size which exceeds the limits of the node's file system.

Note: Currently this pipelet supports Solr 1.4. The integration of features added with the release of Solr 1.5 will be accomplished in the near future.

Configuration

Property Constraint Description
executionMode Optional The execution mode of the pipelet, default is ADD.
allowDoublets Optional The instruction for Solr if doublets are allowed, default is false.
commitWithin Optional The commit interval for Solr in miliseconds, default is 10000.
indexname Optional The name of the index/core on which Solr should operate. Currently we do not support more than one index/core.

Example

Pipelet configuration for SolrIndexPipelet in addpipeline.bpel

<extensionActivity>
  <proc:invokePipelet name="invokeSolrPipelet">
    <proc:pipelet class="org.eclipse.smila.integration.solr.SolrIndexPipelet" />
    <proc:variables input="request" />
    <proc:configuration>
      <rec:Val key="executionMode">ADD</rec:Val>
      <rec:Val key="allowDoublets" type="boolean">false</rec:Val>
      <rec:Val key="commitWithin" type="long">10000</rec:Val>
      <rec:Val key="indexname">test_index</rec:Val>
    </proc:configuration>
  </proc:invokePipelet>
</extensionActivity>

org.eclipse.smila.integration.solr.SolrSearchPipelet

Description

This pipelet integrates Apache Solr's HTTP REST API (http://wiki.apache.org/solr/SearchHandler?action=show&redirect=StandardRequestHandler and http://wiki.apache.org/solr/UpdateXmlMessages ) for searching in a Solr index.

Note: Currently this pipelet supports Solr 1.4. The integration of features added with the release of Solr 1.5 will be accomplished in the near future.

Configuration

From the search request, the pipelet uses the standard search parameters query, maxcount, offset, and resultAttributes. In addition to that, the following properties can be set in the pipelet configuration:

Property Constraint Description
highlight Optional The highlight flag, default is true.
highlight.params Optional All highlighting parameters passed directly to Solr. For more details, please see http://wiki.apache.org/solr/HighlightingParameters.

Example

Pipelet configuration for SolrSearchPipelet in searchpipeline.bpel

<extensionActivity>
  <proc:invokePipelet name="invokeSolrPipelet">
    <proc:pipelet class="org.eclipse.smila.integration.solr.SolrSearchPipelet" />
    <proc:variables input="request" />
    <proc:configuration>
      <rec:Seq key="shards">
        <rec:Val>localhost:8983/solr</rec:Val>
      </rec:Seq>
      <rec:Val key="highlight" type="boolean">true</rec:Val>
      <rec:Seq key="highlight.params">
        <rec:Val>hl.fl=Content</rec:Val>
        <rec:Val>hl.snippets=3</rec:Val>
        <rec:Val>hl.simple.pre=&lt;b&gt;</rec:Val>
        <rec:Val>hl.simple.post=&lt;/b&gt;</rec:Val>
        <rec:Val>hl.fragsize=300</rec:Val>
        <rec:Val>hl.mergeContiguous=false</rec:Val>
      </rec:Seq>
    </proc:configuration>
  </proc:invokePipelet>
</extensionActivity>

Back to the top