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

Term suggest API #460

Merged
merged 13 commits into from
Sep 20, 2013
Merged

Term suggest API #460

merged 13 commits into from
Sep 20, 2013

Conversation

lonamiaec
Copy link

I've started to make possible tu use term suggest API (http://www.elasticsearch.org/guide/reference/api/search/term-suggest/).
I've make some code which uses this to query elastic search and everything gone right on this scenarios:

  • completed 1 term
  • multiple terms
  • global suggest term ( I have to add this option ).

I have executed the original tests and gave me the same results before and after my modifications, so i would like to start discussing if my implementation its good enough or not, and what parts I must change ( or all )
As I've said, It's still pending to add global suggest term option and tests for this, but this is the easiest part.

@@ -110,12 +110,16 @@ public function setParams(array $params)
*/
public function addParam($key, $value)
{
if (!isset($this->_params[$key])) {
$this->_params[$key] = array();
if($key != NULL) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use null instead of NULL

@ruflin
Copy link
Owner

ruflin commented Sep 17, 2013

@lonamiaec Finally I get back to you. I think it goes in the right direction. So far I have not used suggest myself but if I ready the elasticsearch docs this is the way to go. It seems like this is going to grow. Some additional tests would be nice.

@lonamiaec
Copy link
Author

@ruflin I've added an small test for testing the structure created to query elastic search, and fixed small things you said before

@ruflin
Copy link
Owner

ruflin commented Sep 19, 2013

As this is a completely new implementation I would suggest that we add some more tests, especially also test the calls to elasticsearch (not only the structure). Like this we are also aware in case the implementation changes.

@lonamiaec
Copy link
Author

@ruflin here are some more tests. Also change the resultSet to give only suggest search results, not shards info

@lonamiaec
Copy link
Author

Ok, now i think everything is ok. Some fixes and tests runing

@ruflin
Copy link
Owner

ruflin commented Sep 20, 2013

Looks good. The only thing now missing is the update to the changes.txt file (make sure to merge the newest one from master).

@lonamiaec
Copy link
Author

Ok, done

ruflin added a commit that referenced this pull request Sep 20, 2013
@ruflin ruflin merged commit c4373e5 into ruflin:master Sep 20, 2013
* Suggest query or not
*
* @var int suggest
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docblock is broken here.

@ruflin
Copy link
Owner

ruflin commented Sep 21, 2013

@damienalexandre Unfortunately I already merged this pull request. @lonamiaec Can you open a second one with these fixes?

@lonamiaec
Copy link
Author

Of course @ruflin I'll do it today! Thanks @damienalexandre

@damienalexandre
Copy link
Contributor

Yes sorry to review after the merge, I was busy busy, this is nice work @lonamiaec - we may close #378 now, what do you think?

@ruflin
Copy link
Owner

ruflin commented Sep 21, 2013

Agree. The suggest feature will be extended in the future step by step.

@lonamiaec
Copy link
Author

Agree too, i'll work on the rest of the suggest api functionalities

@lonamiaec lonamiaec deleted the suggest branch September 21, 2013 09:11
@lonamiaec lonamiaec mentioned this pull request Sep 21, 2013
Merged
tiger-seo added a commit to tiger-seo/Elastica that referenced this pull request Jun 1, 2016
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.

3 participants