Silverstripe-solr-search - Advanced searching with SilverStripe, Solarium and Solr

Overview

Maintainability Scrutinizer Code Quality Code Coverage CircleCI codecov Test Coverage Build Status Support us

Master is no longer the main branch. If you are using dev-master, switch to dev-primary

ko-fi

Modern SilverStripe Solr Search

Full documentation or see the docs folder. Please read the documentation before asking questions. A lot of the questions are answered by reading the documentation.

Solarium documentation:

https://solarium.readthedocs.io

API Docs:

https://firesphere.github.io/solr-api/

Usage and installation docs:

https://firesphere.github.io/solr-docs/

Supports

Solr4 backward compatibility is available, default support is Solr8

Installation

composer require firesphere/solr-search

More details can be found in the docs.

Cow?

Cow!


             /( ,,,,, )\
            _\,;;;;;;;,/_
         .-"; ;;;;;;;;; ;"-.
         '.__/`_ / \ _`\__.'
            | (')| |(') |
            | .--' '--. |
            |/ o     o \|
            |           |
           / \ _..=.._ / \
          /:. '._____.'   \
         ;::'    / \      .;
         |     _|_ _|_   ::|
       .-|     '==o=='    '|-.
      /  |  . /       \    |  \
      |  | ::|         |   | .|
      |  (  ')         (.  )::|
      |: |   |;  U U  ;|:: | `|
      |' |   | \ U U / |'  |  |
      ##V|   |_/`"""`\_|   |V##
         ##V##         ##V##
Comments
  • How to make Solr case insensitive

    How to make Solr case insensitive

    Is there a way to make Solr searches case insensitive? It seems to be dependant on wether the filesystem is case sensitive or not. Our local test environment is case insensitive, yet production server is, thus causing problems.

    Right now, we've come up with a quick fix for this issue by adding extra altered searchterms. I am wondering if there is a better way to do this?

    $query = new BaseQuery();
    $query->setStart($start);
    $query->setRows(12);
    $query->setSpellcheck(true);
    
    // TMP CASE INSENSITIVE FIX
    $query->addTerm(strtoupper($searchTerm));
    $query->addTerm(ucfirst($searchTerm));
    $query->addTerm(strtolower($searchTerm));
    

    Maybe someone can explain how to do this properly.

    bug 
    opened by RVXD 16
  • Prevent SolrIndexJob from being manually run in the CMS

    Prevent SolrIndexJob from being manually run in the CMS

    Describe the bug

    Creating and attempting to run the SolrIndexJob in the CMS' "Jobs" section will result in errors becuase PCNTL is required by the SolrIndexTask which is never going to be available in any non-CLI, PHP SAPI.

    To Reproduce

    • Login to the CMS
    • Select SolrIndexJob from the "Job ot create" dropdown in the "Jobs" admin
    • Attempt to run it
    • Observe error in browser's network tab

    Expected behavior

    SolrIndexJob should not appear with a "Run" icon in the Jobs GridField. It is only invoked by ProcessJobQueTask via the CLI

    question 
    opened by phptek 13
  • Unable to run SolrConfigureTask for 1.0-beta3

    Unable to run SolrConfigureTask for 1.0-beta3

    Describe the bug

    • PHP7.2 + Solr 8.2 + v4.3.3 + Module 1.0-beta3 + Ubuntu Bionic (Vagrant + LXD)y
    • Run sudo ./vendor/bin/sake dev/tasks/SolrConfigureTask
    • Result:
    ERROR [Emergency]: Uncaught LogicException: No classes or config to index found!
    IN GET dev/tasks/SolrConfigureTask
    Line 184 in /vagrant/vendor/firesphere/solr-search/src/Indexes/BaseIndex.php
    

    My BaseIndex subclass has not changed since I used 7c78fb8c62618f, so the module's API must've changed?

    Looking back at BaseIndex.php @ 7c78fb8c6261 and I'm non the wiser...

    To Reproduce

    • Install ^1.0
    • Run SolrConfigureTaskl
    • Observe errors to do with missing config

    Expected behavior

    No errors.

    question Bug? 
    opened by phptek 13
  • Module doesn’t support authentication

    Module doesn’t support authentication

    E.g: https://lucene.apache.org/solr/guide/8_5/basic-authentication-plugin.html

    Example yaml config:

    Firesphere\SolrSearch\Services\SolrCoreService:
      config:
        endpoint:
          localhost:
            username: 'solr'
            password: 'SolrRocks'
    

    Most of the module does work if you hack around the parts that don’t work. These are:

    I’m not sure if it’s best to try to hack in some auth into these specific cases, or try to make them use the main Solarium instance that does support auth.

    bug enhancement help wanted High priority 
    opened by kinglozzer 12
  • NEW: Allow Criteria objects to be passed to filter/exclude (closes #205)

    NEW: Allow Criteria objects to be passed to filter/exclude (closes #205)

    @Firesphere I know you said you preferred an $escape argument, but I wanted to show how simple the change set would be for accepting Criteria objects as filters. Usage example:

    $criteria = Criteria::where('Document_Embargo')
        ->greaterThanEqual('NOW');
    $query->addExclude('Document_Embargo', $criteria);
    

    This also means we can leave the existing escaping in QueryComponentFactory untouched

    enhancement Bugfix 
    opened by kinglozzer 11
  • Improve existing documentation around

    Improve existing documentation around "ShowInSearch"

    Documentation improvement to be made to 03-Usage.md. Please see the diff here: https://github.com/Firesphere/silverstripe-solr-search/compare/master...phptek:improved-docs

    Bug? Documentation 
    opened by phptek 10
  • Bugfixes for #192 and #193

    Bugfixes for #192 and #193

    Hi there and thank you for taking the time and effort to make a Pull Request

    No, seriously, we are delighted you made time and effort to help us, even in the smallest way!

    Please check the following

    • [x] Have you opened an issue to discuss the feature and agree its general design?
    • [x] Do you have a use case and, ideally, an example program using the feature?
    • [x] Do you have tests covering 90%+ of the feature code (and, of course passing)
    • [x] Have you written complete and accurate doc comments?
    • [x] Have you updated the README or docs where needed?
    • [x] Code is readable
    • [x] Code is tested
    • [x] I've read the Code of Conduct (Or, at least, I do believe I agree with it)
    • [x] Frontend features don't look completely uncared for
    • [x] Code is PSR-2 compliant
    • [x] I'm fairly sure this is useful
    • [x] I'm not just making this PR for HacktoberFest
    • [x] You rock. Thanks a lot.
    Bugfix 
    opened by Firesphere 7
  • Why is SetRows doubled?

    Why is SetRows doubled?

    Sorry, not sure if this is a bug... But at least it's bugging me...

    Using setRows on BaseQuery, causes Results to get doubled.

    Code that causes this: QueryComponentFactory.php line: 92

    // Double the rows in case something has been deleted, but not from Solr
    $this->clientQuery->setRows($this->query->getRows() * 2);
    

    Question Why are the results doubled. Wouldn't it be easier to clean up the Solr in the indexing task?

    PaginatedMatches PaginatedMatches is not working correctly, also doubles the result. Can be fixed in template by adding the same .Limit(9) again. Not sure if that was the intended way of handling things.

    $query = new BaseQuery();
    $query->setStart($start);
    $query->setRows(9); // causes 18 results
    
    <ul>
       <% loop $Results.Limit(9) %>
          <li>
             <% include SilverShop/Includes/ProductGroupItem %>
          </li>
       <% end_loop %>
     </ul>
    <% with $Results %>
        <% include Pagination %>
    <% end_with %>
    

    Thank you for this nice module!

    bug Requirement 
    opened by RVXD 7
  • PHP8 support requires Solarium update

    PHP8 support requires Solarium update

    Is your feature request related to a problem? Please describe. The version of Solarium used does not support PHP8. More recent versions do, and I've installed it using an alias "solarium/solarium": "6.2.1 as 5.2.0"

    Describe the solution you'd like Updating Solarium to ^6.0 allows the software to run on PHP8

    bug enhancement Documentation 
    opened by elliot-sawyer 6
  • SolrCoreService::updateItems() fails when $items is null

    SolrCoreService::updateItems() fails when $items is null

    Describe the bug

    For some reason SolrCoreService::updateItems() is being passed null as the $items param, when running the dev/tasks/SolrClearDirtyClasses from the CLI and browser. When this happens I see the following error:

    ERROR [Notice]: Trying to get property 'ClassName' of non-object IN GET dev/tasks/SolrClearDirtyClasses Line 150 in /vagrant/vendor/firesphere/solr-search/src/Services/SolrCoreService.php

    To Reproduce

    • [OK] Configure
    • [OK] Index
    • [OK] Search
    • [OK] dev/tasks/SolrClearDirtyClasses

    Expected behavior

    No errors are observed and I can run the dev/tasks/SolrClearDirtyClasses task without issue.

    Additional context

    Interestingly, running the task still seemed to clear out records with dirty IDs, with ref to the CMS UI.

    Bug? 
    opened by phptek 6
  • Cores data not persisted to correct dir in

    Cores data not persisted to correct dir in "test" mode

    Describe the bug

    PHP 7.2 + v4.4.3 + Solr 8.20 + dev-master#7c78fb8c62618fbd50c926e5772457c827a6f4f0 (If you can convince me the latest build will also fix this issue, I'll update the version - OK, I tried ^1.0-beta3, different errors: #158)

    Uable to save config anywhere other than a local .solr dir.

    Attempting to use a different dir for storing Solr's core data, defined in YML results in a local .solr dir being re-created and populated instead regardless.

    To Reproduce

    Set the site into "test" mode and use the following local YML config, and run the Configure task:

    ---
    Name: my-search
    After: 'SolrSearch'
    ---
    Only:
      environment:
        - live
        - test
    ---
    Firesphere\SolrSearch\Services\SolrCoreService:
      config:
        endpoint:
          myhostname:
            host: localhost
            port: 8983
            timeout: 10
            # set up timeouts
            index_timeout: 10
            optimize_timeout: 100
            finalize_timeout: 300
            http_method: 'AUTO'
            # commit within 60ms
    

    Expected behavior

    Cores and metadata are persisted to "'/opt/solr/server/solr" and not ".solr"

    question 
    opened by phptek 6
  • Hans/dependency resolving

    Hans/dependency resolving

    Hi there and thank you for taking the time and effort to make a Pull Request

    No, seriously, we are delighted you made time and effort to help us, even in the smallest way!

    Please check the following

    • [ ] Have you opened an issue to discuss the feature and agree its general design?
    • [ ] Do you have a use case and, ideally, an example program using the feature?
    • [ ] Do you have tests covering 90%+ of the feature code (and, of course passing)
    • [ ] Have you written complete and accurate doc comments?
    • [ ] Have you updated the README or docs where needed?
    • [ ] Code is readable
    • [ ] Code is tested
    • [ ] I've read the Code of Conduct (Or, at least, I do believe I agree with it)
    • [ ] Frontend features don't look completely uncared for
    • [ ] Code is PSR-2 compliant
    • [ ] I'm fairly sure this is useful
    • [ ] I'm not just making this PR for HacktoberFest
    • [ ] You rock. Thanks a lot.
    opened by Firesphere 0
  • Update composer.json

    Update composer.json

    Hi there and thank you for taking the time and effort to make a Pull Request

    No, seriously, we are delighted you made time and effort to help us, even in the smallest way!

    Please check the following

    • [ ] Have you opened an issue to discuss the feature and agree its general design?
    • [ ] Do you have a use case and, ideally, an example program using the feature?
    • [ ] Do you have tests covering 90%+ of the feature code (and, of course passing)
    • [ ] Have you written complete and accurate doc comments?
    • [ ] Have you updated the README or docs where needed?
    • [ ] Code is readable
    • [ ] Code is tested
    • [ ] I've read the Code of Conduct (Or, at least, I do believe I agree with it)
    • [ ] Frontend features don't look completely uncared for
    • [ ] Code is PSR-2 compliant
    • [ ] I'm fairly sure this is useful
    • [ ] I'm not just making this PR for HacktoberFest
    • [ ] You rock. Thanks a lot.
    opened by Firesphere 0
  • Remove guzzle6-adapter?

    Remove guzzle6-adapter?

    Describe the bug The module will not install on a PHP 8.0.x installation without some persuasion

    To Reproduce Steps to reproduce the behavior:

    1. Try to install composer require firesphere/solr-search
    2. Observe php-http/guzzle6-adapter[v2.0.0, ..., v2.0.1] require php ^7.1 -> your php version (8.0.25) does not satisfy that requirement.
    3. Install this instead: composer require php-http/guzzle6-adapter 2.0.2 (this specific tag added "untested" PHP8.0 support)
    4. Then install Guzzle 7, as 6 composer require guzzlehttp/guzzle 7.5.0 as 6.5.7
    5. Finally composer require firesphere/solr-search 2.0.0-rc1

    Expected behavior I should be able to install the module when Guzzle 7 is present, but the project forces the install of 6 because the guzzle6-adapter is pulled in as a dependency. If the project can use 7 (as indicated in the requirements), the parent project should be responsible for using the guzzle6-adapter if they want to use 6

    Context Using php:8.0-apache-focal container

    opened by elliot-sawyer 1
  • Bump terser from 4.8.0 to 4.8.1

    Bump terser from 4.8.0 to 4.8.1

    Bumps terser from 4.8.0 to 4.8.1.

    Changelog

    Sourced from terser's changelog.

    v4.8.1 (backport)

    • Security fix for RegExps that should not be evaluated (regexp DDOS)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 3
  • Docker: PHP7.4 image and solr

    Docker: PHP7.4 image and solr

    Hi there and thank you for taking the time and effort to make a Pull Request

    No, seriously, we are delighted you made time and effort to help us, even in the smallest way!

    Please check the following

    • [ ] Have you opened an issue to discuss the feature and agree its general design?
    • [ ] Do you have a use case and, ideally, an example program using the feature?
    • [ ] Do you have tests covering 90%+ of the feature code (and, of course passing)
    • [ ] Have you written complete and accurate doc comments?
    • [ ] Have you updated the README or docs where needed?
    • [ ] Code is readable
    • [ ] Code is tested
    • [ ] I've read the Code of Conduct (Or, at least, I do believe I agree with it)
    • [ ] Frontend features don't look completely uncared for
    • [ ] Code is PSR-2 compliant
    • [ ] I'm fairly sure this is useful
    • [ ] I'm not just making this PR for HacktoberFest
    • [ ] You rock. Thanks a lot.
    opened by marczhermo 0
  • Hans/guzzle to psr test

    Hans/guzzle to psr test

    Hi there and thank you for taking the time and effort to make a Pull Request

    No, seriously, we are delighted you made time and effort to help us, even in the smallest way!

    Please check the following

    • [ ] Have you opened an issue to discuss the feature and agree its general design?
    • [ ] Do you have a use case and, ideally, an example program using the feature?
    • [ ] Do you have tests covering 90%+ of the feature code (and, of course passing)
    • [ ] Have you written complete and accurate doc comments?
    • [ ] Have you updated the README or docs where needed?
    • [ ] Code is readable
    • [ ] Code is tested
    • [ ] I've read the Code of Conduct (Or, at least, I do believe I agree with it)
    • [ ] Frontend features don't look completely uncared for
    • [ ] Code is PSR-2 compliant
    • [ ] I'm fairly sure this is useful
    • [ ] I'm not just making this PR for HacktoberFest
    • [ ] You rock. Thanks a lot.
    opened by marczhermo 0
Releases(2.0.0-rc1)
  • 2.0.0-rc1(Aug 18, 2022)

    What's Changed

    • Bump elliptic from 6.5.3 to 6.5.4 by @dependabot in https://github.com/Firesphere/silverstripe-solr-search/pull/234
    • FIX: Extension hook is broken on reports Gridfield by @elliot-sawyer in https://github.com/Firesphere/silverstripe-solr-search/pull/241
    • Hans/upgrades by @Firesphere in https://github.com/Firesphere/silverstripe-solr-search/pull/245
    • A more efficient/readable version check by @Firesphere in https://github.com/Firesphere/silverstripe-solr-search/pull/260
    • Change Guzzle HTTP Adapter to PSR Adapter by @Firesphere in https://github.com/Firesphere/silverstripe-solr-search/pull/254

    Full Changelog: https://github.com/Firesphere/silverstripe-solr-search/compare/1.1.1...2.0.0-rc1

    Source code(tar.gz)
    Source code(zip)
  • 1.1(Oct 4, 2020)

  • 1.0(Jul 4, 2020)

  • 1.0-rc2(Mar 31, 2020)

  • 1.0-rc1(Jan 3, 2020)

  • 1.0-beta5(Dec 22, 2019)

  • 1.0-beta4(Dec 14, 2019)

    • Fix for pagination error
    • Updated documentation
    • Improved debugging documentation
    • API CHANGE: Changed self-detected Facets to determined facets
    • Permissions now Group based
    • Bugfixes
    Source code(tar.gz)
    Source code(zip)
  • 1.0-beta3(Dec 8, 2019)

  • 1.0-beta2(Nov 30, 2019)

  • 1.0-beta1(Nov 28, 2019)

  • 0.9.0(Nov 26, 2019)

  • 0.8.2(Nov 25, 2019)

  • 0.8.1(Nov 2, 2019)

  • 0.8(Sep 17, 2019)

  • 0.7.5(Aug 31, 2019)

    Please see the github logs for the changes. Notable changes:

    • Added Add[X]Fields()
    • Fix spellcheck retry
    • Increased test coverage
    • Support for basic Fluent (select your language for each indexing run)
    • Documentation
    Source code(tar.gz)
    Source code(zip)
  • 0.5(Aug 16, 2019)

    • Support for Solr8
    • Support for Faceting
    • Support for Subsites
    • Support for Boosting
    • Support for Filters
    • Support for custom index names
    • Based on Solarium
    • Added inspections and tests
    • Simplified inspection and finding of data
    • YML support for configuration
    • Docs
    • Indexing and Configuring jobs and tasks
    • UK to US synonyms
    • Post and File config stores
    • Boosting at Index time
    Source code(tar.gz)
    Source code(zip)
Owner
Simon Erkelens
At the edge of sanity
Simon Erkelens
Search music with voice

Configuration: Open the index.php file and paste the bot token: define('API_KEY', 'TOKEN'); Login to Ahangify and create an account Open the login.php

#[A]ref 1 Jul 21, 2022
VideoColor PHP Search Client

This library is designed to find information about a movie and get the frame position using a screenshot from a video.

null 3 Oct 9, 2022
The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.

DeviceDetector Code Status Description The Universal Device Detection library that parses User Agents and detects devices (desktop, tablet, mobile, tv

Matomo Analytics 2.4k Jan 9, 2023
Toxiproxy PHP Client - Toxiproxy makes it easy and trivial to test network conditions, for example low-bandwidth and high-latency situations

Toxiproxy makes it easy and trivial to test network conditions, for example low-bandwidth and high-latency situations. toxiproxy-php-client includes everything needed to get started with configuring Toxiproxy upstream connection and listen endpoints.

Adrian Parker 29 Jun 24, 2022
Laravel Package for 1APP. Learn how to integrate our APIs to build a web or mobile integration to send and accept payments for your application and businesses.

1APP Laravel Library Learn how to integrate our APIs to build a web or mobile integration to accept payments, make payment of Bills and as well custom

O'Bounce Technologies 4 Jul 25, 2022
A simple PHP GitHub API client, Object Oriented, tested and documented.

PHP GitHub API A simple Object Oriented wrapper for GitHub API, written with PHP. Uses GitHub API v3 & supports GitHub API v4. The object API (v3) is

KNP Labs 2k Jan 7, 2023
A PHP library for communicating with the Twilio REST API and generating TwiML.

twilio-php The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio API c

Twilio 1.4k Jan 2, 2023
A Laravel package to retrieve pageviews and other data from Google Analytics

Retrieve data from Google Analytics Using this package you can easily retrieve data from Google Analytics. Here are a few examples of the provided met

Spatie 2.8k Jan 7, 2023
PHP library to use IOTA REST API to help node management and tangle queries

iota.php About PHP library to use IOTA REST API to help node management and tangle queries. Please be aware that this library is in an early developme

IOTA Community 45 Dec 13, 2022
A simple API documentation package for Laravel using OpenAPI and Redoc

Laravel Redoc Easily publish your API documentation using your OpenAPI document in your Laravel Application. Installation You can install this package

Steve McDougall 15 Dec 27, 2022
A PHP class for querying the Twitter API and rendering tweets as an HTML list

TweetPHP A PHP class for querying the Twitter API and rendering tweets as an HTML list. Features Works with Twitter API v1.1 Tweets are cached to avoi

Jonathan Nicol 151 Nov 25, 2022
playSMS is a web interface for SMS gateways and bulk SMS services

README Latest development release is playSMS version 1.4.4-beta4 Latest stable release is playSMS version 1.4.3 Official project website: https://play

playSMS 662 Dec 31, 2022
DigitalOcean API v2 client for Symfony and API Platform

DigitalOcean Bundle for Symfony and API Platform DunglasDigitalOceanBundle allows using the DigitalOcean API from your Symfony and API Platform projec

Kévin Dunglas 25 Jul 27, 2022
A tool for sending fast and managed messages to Telegram bot users

???? HiToAll A tool for sending fast and managed messages to Telegram bot users About In some telegram bots programmed with php language, if there are

Matin Najafi 3 Oct 3, 2021
Implementation of hopper logic for pushing, pulling and picking up items for PocketMine-MP.

VanillaHopper In pm4, hopper blocks were implemented to have an inventory. But the logic for pushing, pulling and picking up items was missing nonethe

Colin 14 Dec 14, 2022
PHP package providing easy and fast access to Twitter API V2.

Twitter API V2 is a PHP package that provides an easy and fast access to Twitter REST API for Version 2 endpoints.

Julien SCHMITT 38 Dec 12, 2022
Generate pretty release changelogs using the commit log and Github API.

zenstruck/changelog Generate pretty release changelogs using the commit log and Github API. Changelog entries are in the following format: {short hash

Kevin Bond 3 Jun 20, 2022
A laravel 5 package for reading and writing to facebook graph object with ease in laravelish syntax

Fluent-Facebook Docs A laravel 5 package for reading and writing to facebook graph object with ease in laravelish syntax. Check out how easy it is to

iluminar 47 Dec 8, 2022