Coder Social home page Coder Social logo

rohberg / volto-searchkit-block Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 2.71 MB

Plone block with OpenSearch powered faceted search

License: MIT License

JavaScript 89.84% Less 5.56% Makefile 4.60%
search find fuzzy volto volto-addon volto-block german compound elasticsearch-queries opensearch

volto-searchkit-block's Introduction

Features of @rohberg/volto-searchkit-block

Search block with highly overridable components for searching, filtering and displaying search results. Sometimes also called faceted navigation.

As this search is addressing OpenSearch/ElasticSearch with text analysis, the search does understand inflection of words, tolerates typos by fuzzy searching, allows exact search and wildcard search. See User documentation on how to search.

Matched phrases are shown with highlighted matches.

Additional metadata per result item can be configured easily. Meta data values are clickable to find related content.

The block is prepared for Matomo analytics.

Search @rohberg/volto-searchkit-block

Getting started

Install Plone backend add-on collective.elastic.plone 2.x to provide the Plone REST API service which accepts queries and requests OpenSearch/ElasticSearch.

Install Plone backend add-on collective.elastic.ingest 2.x to index Plone content.

Setting up OpenSearch/ElasticSearch instructions can be found on collective.elastic.plone 2.x. See the example configuration of collective.elastic of a mapping, attachment handling and last but not least analysis.

Configuration

The block is not for editors. So please enable adding a searchkit block once by

config.blocks.blocksConfig.searchkitblock.restricted = true;

and disable the block after adding it to a page of your choice.

The block can be configured by

  • searchable fields with boosting
  • facets
  • restricting types and states
  • results meta data

Configuration

Enable Matomo tracking via

  config.settings.searchkitblock.trackVoltoMatomo = true

Overriding components

Components of @rohberg/volto-searchkit-block can be overridden via its overridableId:

const MySearchkitResultsListItem = ({ result, index }) => {
  return (
    <div>
      <Header as="h3">
        <Link to={flattenESUrlToPath(result['@id'])}>
          {result.title}
        </Link>
      </Header>
    </div>
  );
};

config.settings.searchkitblock.overriddenComponents = {
  'ResultsList.item.elasticsearch': MySearchkitResultsListItem,
};

Panel for testing matches

/controlpanel/test-searchkit-querystrings

Please update the settings according to your deployment: /controlpanel/volto_searchkit_block_control_panel

User documentation

The search is a fuzzy search, that means typos are compensated. Approximate matches and inflections are found.

To force the match of a search string, precede it with "+". To exclude matches of a search string, precede it with "-".

Use wildcards to find matches of words that complement the search string.

For exact matches of a search string embrace it with quotation marks.

A search for a word with hyphen is equivalent to a search for the word and the parts of it.
Example: A search for "LSR-Lehrbetrieb" is equivalent to a search for "LSR-Lehrbetrieb LSR Lehrbetrieb"

Words with hyphen are matched by searches for part of the words.
Example: "LSR-Lehrbetrieb" is found by a search for "LSR".

Multiple search strings

Search results do include at least one of the search strings.

Credits

This package is a Plone Volto integration of react-searchkit https://www.npmjs.com/package/react-searchkit Copyright (C) 2015-2019 CERN.

Copyright and license

Copyright (C) 2024 Rohberg.

The project is licensed. See LICENSE for details.

volto-searchkit-block's People

Contributors

dependabot[bot] avatar ksuess avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

bluedynamics

volto-searchkit-block's Issues

indexed plone6/volto objects have no @id property, cannot be displayed as search results

Hello there,

I would like to use this add-on with volto/plone6 objects.
Maybe there was something wrong with my mappings.json file, but my indexed volto objects (with collective.elastic.ingest and collective.elastic.plone) have no @id property.
That's why I receive a "cannot receive properties of undefined"-error in the flattenESUrlToPath function --> src/components/helpers.jsx#L18

I used following workaround for this problem to display the search results in the TestSearchkitQuerystrings view:

src/components/Views/TestSearchkitQuerystrings.jsx#L86
<Link to={flattenESUrlToPath(result['@components']['navigation']['@id'])} target="_blank">

src/components/helpers.jsx#L21
for (let i = 4; i < (pathArray.length-1); i++) {

here I posted my mappings.json in an collective.elastic.ingest issue:
collective/collective.elastic.ingest#17

As I said, I'm not really sure if this issue could be already resolved by changing the mappings.json file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.