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

Add MatchPhrase and MatchPhrasePrefix classes #599

Closed
ThePixelDeveloper opened this issue Apr 28, 2014 · 15 comments
Closed

Add MatchPhrase and MatchPhrasePrefix classes #599

ThePixelDeveloper opened this issue Apr 28, 2014 · 15 comments

Comments

@ThePixelDeveloper
Copy link

Came up to using these features and realise Elastica didn't have the classes for them.

Features defined in ES here:

  1. match_phrase
  2. match_phrase_prefix

Worth adding new classes for these?

@ruflin
Copy link
Owner

ruflin commented Apr 28, 2014

Good question. In the documentation there are 2 ways of doing it: Either through the model or through the type. So in case we do additional classes, I would suggest that it is only a mapper for the Match query which calls the functions. What is your take on this?

@ThePixelDeveloper
Copy link
Author

I forgot about the 2nd way of doing it, but it sounds fine to me.

@ruflin
Copy link
Owner

ruflin commented Apr 28, 2014

We should only choose the second one, in case it simplifies things. Can you open a pull request with one of the two?

@yellow1912
Copy link

Any update on this? I'm looking for a way to use match_phrase_prefix as well

@ruflin
Copy link
Owner

ruflin commented Jun 30, 2014

@yellow1912 There is not pull request for it yet. Do you have time to contribute it?

@yellow1912
Copy link

Im not familiar with the standards set but I will fork and try.

@ruflin
Copy link
Owner

ruflin commented Jul 2, 2014

Cool. Let me know if you need some help.

@Jmoati
Copy link
Contributor

Jmoati commented Nov 20, 2014

To use the second way, just do:

$match = new Query\Match();
$match->setFieldQuery($field, $phrase);
$match->setFieldType($field, 'phrase');

Do you really want classes proxy for that ?
I can do it, if usefull.

@ruflin
Copy link
Owner

ruflin commented Nov 29, 2014

@Jmoati The main reason for the proxy method is probably as most engineers who use Elastica just expect it as there are objects for most of the queries. If you have time to open a pull request, that would be nice.

@yehosef
Copy link

yehosef commented Feb 1, 2015

I think the library is most useful when it matches the documented way of doing it - and if there are two ways of doing the same thing I would prefer that be replicated in the library (obviously with a proxy method).

@olee
Copy link

olee commented Feb 7, 2015

Also there is no method to set slop without having a class for that.
Currently you need to call

$match->setFieldParam('myField', 'slop', 100);

@ruflin
Copy link
Owner

ruflin commented Feb 14, 2015

@yehosef @olee Does anyone of you have some spare time to open a pull request with the mentioned changes?

@yehosef
Copy link

yehosef commented Feb 15, 2015

@ruflin - I'll try.

@ruflin
Copy link
Owner

ruflin commented Feb 16, 2015

@yehosef Thx

@Jmoati
Copy link
Contributor

Jmoati commented Feb 25, 2015

@ruflin Can you please close this issue ?

@ruflin ruflin closed this as completed Feb 26, 2015
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

No branches or pull requests

6 participants