From e7ce9b6f08d19e747054ba4122446108d62c361b Mon Sep 17 00:00:00 2001 From: vmadman Date: Sat, 22 Jun 2013 04:51:06 -0500 Subject: [PATCH] Updated boolean example The boolean query example used the query() method, which does not exist. Instead, it should use the queryBuilder() method. Additionally, if you pass a *single* parameter to must(), should(), or must_not().. then it will be iterated as though it is an array of class that implement \Sherlock\components\QueryInterface. Therefore, you cannot pass a Term() or Match() class directly to the must(), chould(), or must_not() method as previously shown. --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4dcdcf9..8ab1d35 100644 --- a/README.md +++ b/README.md @@ -103,19 +103,20 @@ The library interface is still under flux...this section will be updated once _S //Let's try a more advanced query now. //Each section is it's own variable to help show how everything fits together - $must = Sherlock::query()->Term()->field("message") + $must = Sherlock::queryBuilder()->Term()->field("message") ->term("ElasticSearch"); - $should = Sherlock::query()->Match()->field("author") + $should = Sherlock::queryBuilder()->Match()->field("author") ->query("Zachary Tong") ->boost(2.5); - $must_not = Sherlock::query()->Term()->field("message") + $must_not = Sherlock::queryBuilder()->Term()->field("message") ->term("Solr"); - $bool = Sherlock::query()->Bool->must($must) - ->should($should) - ->must_not($must_not); + $bool = Sherlock::queryBuilder()->Bool->must( array( $must ) ) + ->should( array( $should ) ) + ->must_not( array ( $must_not ) ); + $request->query($bool); $request->execute();