Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] solr query-builder #434

Closed
wants to merge 1 commit into from
Closed

[Proposal] solr query-builder #434

wants to merge 1 commit into from

Conversation

floriansemm
Copy link
Contributor

Related issue #420

QueryBuilder allows to define queries programmatically.

$builder
    ->select('title', 'content')
    ->where('id')
        ->equals('id_prefix_*')
    ->andWhere('title_s')
        ->equals('a title')
    ->orWhere('tags_ss')
        ->inSet(array('solr', 'symfony'));

A condition starts always with where / andWhere / orWhere, followed by equals($value)/ inSet($values)/ inRange($start, $end)/ inDistance($lat, $long, $distance).

I have also implemented a test-class to show the usage.

The implementation and featureset is very basic and should only start a discussion.

@coveralls
Copy link

coveralls commented Jun 27, 2016

Coverage Status

Coverage decreased (-0.09%) to 95.855% when pulling af9c432 on floriansemm:master into 095d41a on solariumphp:master.

@coveralls
Copy link

coveralls commented Jun 29, 2016

Coverage Status

Coverage decreased (-0.09%) to 95.855% when pulling d402cf5 on floriansemm:master into 095d41a on solariumphp:master.

@dewos
Copy link
Contributor

dewos commented Jun 29, 2016

Interesting, but it is a big step backwards (features-wise) compared to #420, which has not even been merged neither. Probably it would be better to focalize the efforts into one single lib.

@basdenooijer
Copy link
Member

I think it's clear there is demand for a query builder, and I can also see the benefits myself.

As already discussed in #420 I think something like this could be a separate library, as it's very useful even without Solarium.
Since it is related to Solarium, we could create a project under the 'solariumphp' github organization.

@dewos
Copy link
Contributor

dewos commented Jun 30, 2016

@basdenooijer merge, solariumphp/builder, community lib, composer suggestion of my lib, .... the important thing is to do.... something :)

@basdenooijer
Copy link
Member

I don't want to force any of the options. But the way I see it:

  • The community lib option is always open to anyone.
  • I'm also willing to merge a PR that adds such a lib to the composer suggestions
  • If someone wants to take ownership of solariumphp/builder (or whatever name) I'm open for that.

Currently I don't have the time to take the lead in such a project, but if someone wants to do that (or even better, several people?) please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants