Coder Social home page Coder Social logo

netgen / ezplatform-search-extra Goto Github PK

View Code? Open in Web Editor NEW
13.0 7.0 4.0 452 KB

Netgen's extra bits for eZ Platform search

Home Page: https://netgen.io

License: GNU General Public License v2.0

PHP 97.89% Shell 2.11%
php ezplatform ezpublish solr search

ezplatform-search-extra's Introduction

Netgen's extra bits for eZ Platform search

Build Status Read the Docs Downloads Latest stable eZ License

Other versions

  • release compatible with eZ Platform 3.1 is 2.4
  • release compatible with eZ Platform 2.x is 1.14

Features

This only lists all implemented features, see the documentation for more details on specific ones.

  • ContentName criterion that works on matched translation's Content name (solr, legacy)

  • ContentName sort clause that works on matched translation's Content name (solr, legacy)

  • ContentId and LocationId criteria with support for range operators (solr, legacy)

    Supported operators are: EQ, IN, GT, GTE, LT, LTE, BETWEEN.

  • Visible criterion (solr, legacy), usable in both Content and Location search. The criterion works on compound visiblity of Content and Location objects: the Content is visible if it's marked as visible; the Location is visible if it's marked as visible, is not hidden by one of its ancestor Locations, and it's Content is visible.

  • Spellcheck suggestions support (solr)

  • CustomField sort clause (solr)

    Provides a way to sort directly on Solr field by its name.

  • Pagerfanta adapters providing access to extra information returned by the search engine, like facets, aggregations, max score and execution time (solr, legacy):

  • A set of User related criteria (legacy):

  • IsFieldEmpty criterion (solr)

    Requires initial reindexing after installation.

  • ObjectStateIdentifier criterion (solr, legacy)

  • SectionIdentifier criterion (solr, legacy)

  • Support for custom Content subdocuments (Solr search engine) (solr)

    Provides a way to index custom subdocuments to Content document and SubdocumentQuery criterion, available in Content search to define grouped conditions for a custom subdocument.

  • SubdocumentField sort clause (solr)

    Provides a way to sort Content by a subdocument field, choosing score calculation mode and optionally limiting with SubdocumentQuery criterion.

    Note: This will require Solr 6.6 or higher in order to work correctly with all scoring modes.

  • LocationQuery criterion (solr, legacy)

    Allows grouping of Location criteria so that they apply together on a Location.

  • CustomFieldFacetBuilder facet builder (solr)

    Allows building facets on custom Solr fields.

  • RawFacetBuilder facet builder (solr)

    Exposes Solr's JSON facet API in full.

  • Score sort clause (solr)

    Provides a way to sort Content by score value.

  • Random sort clause (solr)

    Provides a way to sort Content randomly.

  • Indexable implementations for RichText and XmlText (solr)

    These implementations shorten text indexed as keyword to 256 characters, which prevents failures when the field's content is too big for Solr's string field. They can be controlled with semantic configuration (showing defaults):

    netgen_ez_platform_search_extra:
        indexable_field_type:
            ezxmltext:
                enabled: true
                short_text_limit: 256
            ezrichtext:
                enabled: true
                short_text_limit: 256
  • Loading implementation of result extractor (solr)

    Loading result extractor gets it's value objects by loading them from the persistence. This prevents:

    • UnauthorizedException failures because of the missing content/versionread permission when Content is updated and incremented current version number is not yet indexed in Solr
    • NotFoundException failures when Content/Location is deleted and the corresponding document is not yet removed from Solr index

    Usage of loading result extractor can be controlled with semantic configuration (showing defaults):

    netgen_ez_platform_search_extra:
        use_loading_search_result_extractor: true

Installation

To install eZ Platform Search Extra first add it as a dependency to your project:

composer require netgen/ezplatform-search-extra:^2.5

Once the added dependency is installed, activate the bundle in app/AppKernel.php file by adding it to the $bundles array in registerBundles() method, together with other required bundles:

public function registerBundles()
{
    ...

    $bundles[] = new Netgen\Bundle\EzPlatformSearchExtraBundle\NetgenEzPlatformSearchExtraBundle;

    return $bundles;
}

ezplatform-search-extra's People

Contributors

bvrbanec avatar emodric avatar hknezevic avatar marioblazek avatar mivancic avatar pspanja avatar randycupic avatar wizhippo avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ezplatform-search-extra's Issues

Bundle not working with Symfony version prior to 3.3

Installing the package via composer passes because there is no require statement on the symfony version, only the ezsystems/ezpublish-kernel.

However, some compiler passes, which are enabled by default, call the Definition method setArgument(), which was added in the Symfony 3.3 and not available in the prior Symfony versions:

https://github.com/netgen/ezplatform-search-extra/blob/master/lib/Container/Compiler/FieldType/RichTextIndexablePass.php#L34

https://github.com/netgen/ezplatform-search-extra/blob/master/lib/Container/Compiler/FieldType/XmlTextIndexablePass.php#L32

https://github.com/netgen/ezplatform-search-extra/blob/master/lib/Container/Compiler/FieldTypeRegistryPass.php#L29

If I manually disable these compiler passes, the rest of the features work nicely, as far as I could tell.

It would be nice if we somehow managed to make this compatible with the Symfony 2.8-3.3, so that we don't lock out the possibility of using this package on the older version of eZ prior to 6.12.

I guess something like this would do (e.g. for the FieldTypeRegistryPass):

if (count($fieldTypeRegistry->getArguments()) > 0) {
    $fieldTypeRegistry->replaceArgument(0, $fieldTypeRegistryClass);
}
else{
    $fieldTypeRegistry->addArgument($fieldTypeRegistryClass);
}

If you agree with this approach, I will open a PR. Otherwise we need to lock out the symfony version in the composer.json.

cc @MarioBlazek @emodric @pspanja

Possibility to use tags on filters

Hello,

i would actually write this on https://github.com/ezsystems/ezplatform-solr-search-engine but unfortunately the issue board is turned off there and the creating the pull-request for that is maybe to early.

It seems though that this problem also exists with your extra bundle.

When trying to exclude filters from facets in order to have f.i. multi-select facets i realized that it is not possible with the current implementation of ezplatform-solr-bundle.

Normally you would do that by tagging your filters and excluding them on the facet, see:
http://yonik.com/multi-select-faceting/

Unfortunately the solr bundle is just sending the whole query as one long query string:
fq={!lucene}bla:123 AND (bar:123) AND (foo:333)
which makes tagging impossible as far as I know, because this could only be achieved like follwoing:

fq[]={!tag=bla_filter}bla:123
fq[]={!tag=foo_filter}foo:333
fq[]={!tag=bar_filter}bar:123

The idea of having an agnostic data-layer where you can use solr as if it was a SQL Database conflicts with this since queries are nested as you would like to:
AND (OR (AND bar=1)))

I am not an expert on solr or maybe there is another way to exclude filters on facets which i am not aware of.

Do you have experience with that? Or is this to be considered a real issue?

Kind regards
Robert (Rozbeh Chiryai Sharahi)

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.