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

FEATURE: Add multi match search #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

unclecheese
Copy link

This allows searching across multiple fields, and boosting them, if required.

$elastic = Injector::inst()->get('SilverStripe\Elastica\ElasticaService');
$results = $elastic->search($query, array('Title^3', 'Content'));

I'm 90% sure this is not going to be your preferred solution, but I figured best to get the dialogue started.

Another approach would be to add a new method, searchMulti instead of the polymorphic approach.

This allows searching across multiple fields, and boosting them, if required.

```php
$elastic = Injector::inst()->get('SilverStripe\Elastica\ElasticaService');
$results = $elastic->search($query, array('Title^3', 'Content'));
```

I'm 90% sure this is not going to be your preferred solution, but I figured best to get the dialogue started.

Another approach would be to add a new method, `searchMulti` instead of the polymorphic approach.
@nyeholt
Copy link
Contributor

nyeholt commented Feb 16, 2015

Andrew's not maintaining the module directly any more, so I'm happy to take in what works for you :) If/when we look at re-working things, it'd probably use a query-builder type of object anyway, so until then I'm happy for things to just be 'whatever works'.

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

Successfully merging this pull request may close these issues.

2 participants