GithubHelp home page GithubHelp logo

pluk77 / symfonysphinxbundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from javer/javersphinxbundle

5.0 5.0 5.0 49 KB

Symfony bundle which provides integration of Sphinx or Manticore search engine with Symfony using SphinxQL

License: Other

PHP 87.13% Twig 12.87%
manticore manticore-search manticoresearch php sphinx sphinxql sphinxsearch symfony symfony-bundle symfony4 symfony5

symfonysphinxbundle's People

Contributors

javer avatar rumours86 avatar studiomax avatar tacman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

symfonysphinxbundle's Issues

Incompatible with KnpPager

            $queryBuilder = $this
                ->postRepository
                ->createQueryBuilder('p')
                ->select();

            $query = $this
                ->sphinx
                ->createQuery()
                ->select('id')
                ->from('poindex1', 'poindex2')
                ->where('post_text', $searchQuery)
                ->useQueryBuilder($queryBuilder, 'p', 'id');

            $pagination = $this->paginator->paginate($query, $page, 12, [
                'sortFieldParameterName' => 'sort',
                'sortFieldWhitelist' => ['post_date'],
                'defaultSortFieldName' => 'post_date',
                'defaultSortDirection' => 'desc'
            ]);

Produces One of listeners must count and slice given target

Impossible to not having a limit

$limit is set to 20 and it's not possible to completely get rid of that if I want to select all the results (to use with db query paginator)

Call to a member function getId() on array

Error caused by code:

            $queryBuilder = $this
                ->postRepository
                ->createQueryBuilder('p')
                ->select('p as post')
            ;

            $query = $this
                ->sphinx
                ->createQuery()
                ->select('id')
                ->from(...$this->sphinxIndices)
                ->match(['post_title', 'post_text'], $searchQuery)
                ->orderBy('post_date', 'desc')
                ->useQueryBuilder($queryBuilder, 'p', 'id')
            ;

Possibly can be fixed if last 'id' parameter can be a custom getter callable.

Order reset for QueryBuilder

Since Sphinx returns document ID's in an ordered manner (if order is provided) and these ids then put to QueryBuilder which searches for entities using "IN" clause, the resulting order of documents retrieved from the database is random. And I guess this:

        if ($this->orderBy) {
            $this->queryBuilder->resetDQLPart('orderBy');
        }

in applyQueryBuilder() doesn't allow to fix the order.

OR condition

Hey! Thanks for your awesome library.
Have a question.
Is it possible to do OR condition? I want to find all occurrences with "foo" and "bar" for example

->match(["title", "content", "tag"], "foo")
->match(["title", "content", "tag"], "bar")

Something like that, but it works like AND condition.

Tried with ->match(["title", "content", "tag"], "foo | bar") but not worked

Add option for default indices

My Sphinx instance is shared between prod and stage envs. Both envs use different databases indeed, but sphinx' index is different. I want to make use of Symfony's configuration and override default config of the bundle to use different index names for each environment. Please make a configuration option that specifies the default index list.

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.