The Delivery Framework is marked as deprecated. It is recommended to use the Sophora WebApp Framework instead.
Maven dependancy
<dependency>
<groupId>com.subshell.sophora</groupId>
<artifactId>com.subshell.sophora.delivery.solr</artifactId>
<version>VERSION</version>
</dependency>
Connection to the Solr-Server
To configure the connection to a Solr-Server, you can set the property sophora.delivery.solr.url
, the default value for this property is http://localhost:1196/solr.
sophora.delivery.solr.url=http://localhost:1196/solr
Setting the username and password for solr server you should use this properties:
# Default: solr
sophora.delivery.solr.user=
# Default: solr
sophora.delivery.solr.password=
Template development
A little code snippet, to show the usage of the Solr-Taglib:
<%@ page pageEncoding="utf-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://www.subshell.com/sophora/solr/jsp" prefix="sophora-solr" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<sophora-solr:search var="result" pageNumber="0" pageSize="1" corename="MY_CORENAME" query="*:*" />
NEXT: ${result.hasNext}<br />
PREVIOUS: ${result.hasPrevious}<br />
NUM: ${result.numFound}<br />
START: ${result.start}<br />
SIZE: ${result.size}<br />
PAGESIZE: ${result.pageSize}<br />
PAGENUMBER: ${result.pageNumber}<br />
<hr />
<c:forEach var="entry" items="${result.entries}">
${entry.id}<hr />
</c:forEach>