Giter Club home page Giter Club logo

silverstripe-searchable's Introduction

SilverStripe Searchable Module

UPDATE - Full Text Search This module now uses Full Text Support for MySQL/MariaDB databases in version 3.*

Adds more complex site searching using the SilverStripe ORM and also adds dedicated templates for search results across multiple search objects.

To get started quickly, install via composer:

composer require i-lateral/silverstripe-searchable

For full documentation check out the docs

silverstripe-searchable's People

Contributors

mak001 avatar makreig avatar mlewis-everley avatar muskie9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

silverstripe-searchable's Issues

Action 'SearchForm' isn't allowed on class...

Hi there,

I just installed the latest version and keep getting the following error : Action 'SearchForm' isn't allowed on class... even after adding the below code to my controllers

    private static $allowed_actions = [
        'SearchForm',
    ];

This is happening with all controllers.

I am running silverstripe 4.6.1

Any idea why?

Thank you

Usage with CMS

I'm using the CMS module, and have a more or less standard website with some topnavigation etc. If I use this search functionality, the search results page is not able to show $Menu etc. because SearchResults extends Controller and not ContentController .

I'd like to know if its correct I'd have to fork this module and set the SearchResults class to extend ContentController, to have it suit my needs?
Is there another way I can achieve access to "normal" ContentController functionality (such as navigation) without changing the module?

Searching subclasses of Page

Is it possible to search objects that extend Page? For instance;
I have a type, Article that extends Page and provides the following extra fields; Author and Summary. SilverStripe will create a database table named Article that containts the above fields as columns, but borrows upon the SiteTree table for the Content and Title field.

I want to be able to search by Author, Summary text, Content text, and Title.. and add the following to _config;

Searchable::add('Article',array('Author','Summary','Content','Title'),'News Articles');

This results in:

[User Error] Couldn't run query: ALTER TABLE "Article" ADD fulltext "SearchFields" ("Author","Summary","Content","Title") Key column 'Content' doesn't exist in table

As those [Content, Title] fields don't exist on the Article table.

Does the module support this scenario?

Many thanks for any ideas.

~ Brice

datalist->remove && controller

in searchable.php
in the results method you use
$results->remove($result);
but this creates a bug that deletes stuff from the DB sometimes (because datalist->remove remove by deleting the object doc here)
this solutions seems to work since removeByID deletes from the list only
$results->removeByID($result->ID);

i also changed
class SearchResults extends Controller
to
class SearchResults extends Page_Controller
for a better integration in my views

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.