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 searchFacet feature #166

Merged
merged 1 commit into from
Oct 20, 2016
Merged

add searchFacet feature #166

merged 1 commit into from
Oct 20, 2016

Conversation

maxiloc
Copy link
Contributor

@maxiloc maxiloc commented Oct 19, 2016

No description provided.

@maxiloc maxiloc force-pushed the search-in-facets branch 4 times, most recently from cabc423 to d3741ee Compare October 19, 2016 11:28
@@ -510,6 +510,26 @@ public function search($query, $args = null)
);
}

public function searchFacet($facetName, $facetQuery, $query = null)
Copy link
Contributor

Choose a reason for hiding this comment

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

If it was $query = array() the condition $query === null could be omitted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I asked myself the same question. I took the same code that what we have for search, we can change it for sure

Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be good :)

// not fatal
}
try {
$this->client->deleteIndex($this->safe_name('àlgol?à2-php'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why àlgol?à2-php index is deleted in this test, when it's not used for the real test?

$this->index->waitTask($task['taskID']);

# Straightforward search.
$facetHits = $this->index->searchFacet('series', 'Hobb')['facetHits'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Accessing array elements right after method call is supported since 5.4. The test will fail on 5.3

@maxiloc maxiloc force-pushed the search-in-facets branch 4 times, most recently from cf33400 to 78c6029 Compare October 19, 2016 11:44
@maxiloc
Copy link
Contributor Author

maxiloc commented Oct 19, 2016

I rebased based on the comment


public function testSearchTest()
{
$settings = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Short array syntax fails on 5.3

@maxiloc maxiloc force-pushed the search-in-facets branch 2 times, most recently from 39154ff to e8ca08b Compare October 20, 2016 08:54
$this->assertEquals($facetHits[0]['count'], 2);

# Using an addition query to restrict search.
$query = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Still bad array syntax :))

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling e8ca08b on search-in-facets into * on master*.

@maxiloc
Copy link
Contributor Author

maxiloc commented Oct 20, 2016

Should be good now

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3665798 on search-in-facets into * on master*.

1 similar comment
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3665798 on search-in-facets into * on master*.

@JanPetr JanPetr merged commit d4f29a1 into master Oct 20, 2016
@JanPetr JanPetr deleted the search-in-facets branch October 20, 2016 11:25
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

3 participants