Skip to main content

Solr integration for Plone

Project description

Introduction

ftw.solr integrates the Solr search engine with Plone.

ftw.solr does not try to replace the portal catalog of Plone and does not hook into the catalog’s search function. Instead it provides a search utiltity that must be used explicitly. It’s meant to be used in search forms for fulltext searches while the portal catalog is still in use for things like navigation or folder contents. The goal is to get rid off all fulltext indexes (e.g. ZCTextIndex) in the portal catalog.

ftw.solr requires Apache Solr 7.0 or higher.

Installation

Add as dependency

Install ftw.solr by adding it to the list of eggs in your buildout or by adding it as a dependency of your policy package.

[instance]
eggs +=
    ftw.solr

Solr installation

To install a Solr server with buildout you can use the ftw.recipe.solr recipe.

[solr]
recipe = ftw.recipe.solr
cores = mycore

Configure the Solr connection

The connections settings for Solr can be configured in ZCML and thus in buildout. Example:

[instance]
zcml-additional =
    <configure xmlns:solr="http://namespaces.plone.org/solr">
        <solr:connection host="localhost" port="8983" base="/solr/mycore"/>
   </configure>

Run buildout

After running buildout and restarting your instance you can install the ftw.solr addon in Plone.

Usage

Get the ISolrSearch utility and call the search method to get search results from Solr.

from ftw.solr.interfaces import ISolrSearch
from zope.component import getUtility

solr = getUtility(ISolrSearch)
resp = solr.search(query=u'SearchableText:foo')

You can get a plone.app.contentlisting style result by adapting IContentListing:

from plone.app.contentlisting.interfaces import IContentListing
listing = IContentListing(resp)

Changelog

2.6.0 (2019-08-19)

  • Use Solr Cell only for text extraction. The SearchableText is now also indexed using the update handler which allows atomic updates. Also fixes #137. [buchi]

  • Fix error when trying to delete an object without a unique key. [jone]

2.5.0 (2019-07-02)

  • Make sure to always update ‘path_depth’ if ‘path’ is (re)indexed. [lgraf]

  • Handle facet_counts in solr response. [njohner]

2.4.0 (2019-06-13)

  • Perform soft commits and wait for new searcher by default to allow near real time (NRT) searching. [buchi]

  • Additionaly index metadata of files using an update command to make them visible as soon as possible. [buchi]

  • Flush optimize command. [buchi]

  • Add support for indexing path depth. [buchi]

2.3.2 (2019-04-29)

  • Fix partial reindexing (atomic updates) for fields without a value. [buchi]

2.3.1 (2018-11-01)

  • Fix reindexObjectSecurity patch to account for special handling of system roles in allowedRolesAndUsers indexer. [lgraf]

2.3.0 (2018-10-18)

  • Patch reindexObjectSecurity to optimize indexing of large trees. [lgraf]

  • Fix diff for items with a modification date that has no fractional seconds. [buchi]

  • Provide an error message when raising an AttributeError in SolrDocument. [buchi]

2.2.0 (2018-09-21)

  • Add option to synchronize Solr with catalog in maintenance view. [buchi]

2.1.2 (2018-05-15)

  • Set Content-Type ‘application/x-www-form-urlencoded’ for requests to /update/extract endpoint to ensure compatibility with Solr 7.3. [lgraf]

  • Maintenance view: Allow reindexing without dooming the transaction. [lgraf]

2.1.1 (2018-02-20)

  • Make sure we do not pass invalid dates to Solr. [buchi]

2.1.0 (2018-02-20)

  • Declare dependency on plone.namedfile[blobs]. [lgraf]

  • Add diff function to maintenance view to compare UIDs in portal catalog with UIDs in Solr. [buchi]

  • Fix security filter: Properly quote roles/users with spaces. [buchi]

  • Add option to reindex Solr from a catalog query. [buchi]

2.0.0 (2018-02-15)

  • Complete rewrite. Not compatible with previous versions. [buchi]

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftw.solr-2.6.0.tar.gz (40.9 kB view details)

Uploaded Source

File details

Details for the file ftw.solr-2.6.0.tar.gz.

File metadata

  • Download URL: ftw.solr-2.6.0.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/36.2.7 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/2.7.12

File hashes

Hashes for ftw.solr-2.6.0.tar.gz
Algorithm Hash digest
SHA256 56d453e1b76514b4c1a8caa62a5ec94a007f4864bc95bcabe2833e1d7ae3f0e0
MD5 da1d014333970866a4f1a6731f199e4b
BLAKE2b-256 8d65e821767a6f956eced4233e2fc8ae1c82777ff0750b71a7d63cc3fff271c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page