-
Notifications
You must be signed in to change notification settings - Fork 115
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
Conversation
cabc423
to
d3741ee
Compare
@@ -510,6 +510,26 @@ public function search($query, $args = null) | |||
); | |||
} | |||
|
|||
public function searchFacet($facetName, $facetQuery, $query = null) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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')); |
There was a problem hiding this comment.
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']; |
There was a problem hiding this comment.
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
cf33400
to
78c6029
Compare
I rebased based on the comment |
|
||
public function testSearchTest() | ||
{ | ||
$settings = [ |
There was a problem hiding this comment.
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
39154ff
to
e8ca08b
Compare
$this->assertEquals($facetHits[0]['count'], 2); | ||
|
||
# Using an addition query to restrict search. | ||
$query = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still bad array syntax :))
Changes Unknown when pulling e8ca08b on search-in-facets into * on master*. |
e8ca08b
to
3665798
Compare
Should be good now |
Changes Unknown when pulling 3665798 on search-in-facets into * on master*. |
1 similar comment
Changes Unknown when pulling 3665798 on search-in-facets into * on master*. |
No description provided.