Git Product home page Git Product logo

pimcore-dynamic-search-index-provider-lucene's Introduction

Dynamic Search | Index Provider: PHP Lucene

Software License Latest Release Tests PhpStan

An index storage extension for Pimcore Dynamic Search. Store data with the PHP Lucene index service.

Release Plan

Release Supported Pimcore Versions Supported Symfony Versions Release Date Maintained Branch
3.x 11.0 ^6.2 28.09.2023 Feature Branch master
2.x 10.0 - 10.6 ^5.4 19.12.2021 No 2.x
1.x 6.6 - 6.9 ^4.4 18.04.2021 No 1.x

Installation

"require" : {
    "dachcom-digital/dynamic-search" : "~3.0.0",
    "dachcom-digital/dynamic-search-index-provider-lucene" : "~3.0.0"
}

Dependencies

This package will also install a fork of ZendSearch to provide the latest PHP compatibility.

Dynamic Search Bundle

You need to install / enable the Dynamic Search Bundle first. Read more about it here. After that, proceed as followed:

Add Bundle to bundles.php:

<?php

return [
    \DsLuceneBundle\DsLuceneBundle::class => ['all' => true],
];

Basic Setup

dynamic_search:
    context:
        default:
            index_provider:
                service: 'lucene'
                options:
                    database_name: 'my_lucene_storage'

Provider Options

Name Default Value Description
database_name null
force_adding_document true
analyzer []

Index Fields

Available Index Fields:

Name Description
binary Binary fields are not tokenized or indexed, but are stored for retrieval with search hits. They can be used to store any data encoded as a binary string, such as an image icon.
keyword Keyword fields are stored and indexed, meaning that they can be searched as well as displayed in search results. They are not split up into separate words by tokenization.
text Text fields are stored, indexed, and tokenized. Text fields are appropriate for storing information like subjects and titles that need to be searchable as well as returned with search results.
unIndexed UnIndexed fields are not searchable, but they are returned with search hits. Database timestamps, primary keys, file system paths, and other external identifiers are good candidates for UnIndexed fields.
unStored UnStored fields are tokenized and indexed, but not stored in the index. Large amounts of text are best indexed using this type of field. Storing data creates a larger index on disk, so if you need to search but not redisplay the data, use an UnStored field.

Output Channel Services

Autocomplete

Identifier: lucene_autocomplete
Available Options:

Name Default Value Description
min_prefix_length 3
use_fuzzy_term_search_fallback true
fuzzy_default_prefix_length
fuzzy_similarity 0.5

Suggestions

Identifier: lucene_suggestions
Available Options:

Name Default Value Description
min_prefix_length 3
result_limit 10
only_last_word_wildcard false
multiple_words_operator 'OR'
restrict_search_fields []
restrict_search_fields_operator 'OR'

Search

Identifier: lucene_search
Available Options:

Name Default Value Description
min_prefix_length 3
max_per_page 10

Multi Search

Identifier: lucene_multi_search
Available Options: none


Filter

RelationsFilter

Identifier: relations
Available Options:

Name Default Value Allowed Type Description
identifier null string
value null string
label null string, null
show_in_frontend true bool
relation_label null closure, null

Output Normalizer

A Output Normalizer can be defined for each output channel.

lucene_document_key_value_normalizer

Available Options:

Name Default Value Description
skip_fields []

Further Information


Copyright and License

Copyright: DACHCOM.DIGITAL
For licensing details please visit LICENSE.md

Upgrade Info

Before updating, please check our upgrade notes!

pimcore-dynamic-search-index-provider-lucene's People

Contributors

dpfaffenbauer avatar pascalmoser avatar scrummer avatar solverat avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pimcore-dynamic-search-index-provider-lucene's Issues

Use zendsearch Library

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
"zendframework/zend-stdlib": "~2.3",
"zendframework/zendsearch": "@dev"

SnowBallStemmingFilter uses not initialized locale

Q A
Branch master,
Bug report? no
Feature request? yes
BC Break report? no
RFC? no

I implemented the bundle into my one-language project. When I trigger the search action, I get following error:
"Error while loading search output channel "search" for "default" context. Error was: Output Channel "search" Exception: Error while calling getResult() on output channel: Typed property DsLuceneBundle\Lucene\Filter\Stemming\SnowBallStemmingFilter::$locale must not be accessed before initialization[ โ—€]()"

This happens due to locale not being initialized in the SnowballStemmingFilter:
protected string $locale;

Is this intended? Can't we assign an empty string as default for those who don't set locale?

Implement "Did you mean?" feature

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes/no

Is it possible to implement a "Did you mean?" feature?
In Lucene it is called "SpellChecker" if I am not wrong.

When this is possible and you can give me a hint how, I can try to create an PR.

How to highlight search term in result HTML?

Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? no

I was wondering if there is any documentation on how to highlight the search term in the results? I saw that the AbstractQuery class has a highlightMatches method. Do you use it in a channel action?

Harmonize Query Term Transformer

Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? no
  • Create Query Term Helper
  • Add it to each output channel service

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.