mirror of
https://github.com/typeable/bloodhound.git
synced 2024-11-29 23:52:20 +03:00
README Updated
This commit is contained in:
parent
e9efc72b65
commit
c17ffc0cde
46
README.org
46
README.org
@ -300,6 +300,52 @@ Right [Hit {hitIndex = IndexName "twitter"
|
||||
|
||||
#+END_SRC
|
||||
|
||||
**** Match Query
|
||||
|
||||
#+BEGIN_SRC haskell
|
||||
|
||||
let query = QueryMatchQuery $ mkMatchQuery (FieldName "user") (QueryString "bitemyapp")
|
||||
let search = mkSearch (Just query) Nothing
|
||||
|
||||
#+END_SRC
|
||||
|
||||
|
||||
**** Multi-Match Query
|
||||
|
||||
#+BEGIN_SRC haskell
|
||||
|
||||
let fields = [FieldName "user", FieldName "message"]
|
||||
let query = QueryMultiMatchQuery $ mkMultiMatchQuery fields (QueryString "bitemyapp")
|
||||
let search = mkSearch (Just query) Nothing
|
||||
|
||||
#+END_SRC
|
||||
|
||||
**** Bool Query
|
||||
|
||||
#+BEGIN_SRC haskell
|
||||
|
||||
let innerQuery = QueryMatchQuery $
|
||||
mkMatchQuery (FieldName "user") (QueryString "bitemyapp")
|
||||
let query = QueryBoolQuery $
|
||||
mkBoolQuery (Just innerQuery) Nothing Nothing
|
||||
let search = mkSearch (Just query) Nothing
|
||||
|
||||
#+END_SRC
|
||||
|
||||
**** Boosting Query
|
||||
|
||||
#+BEGIN_SRC haskell
|
||||
|
||||
let posQuery = QueryMatchQuery $ mkMatchQuery (FieldName "user") (QueryString "bitemyapp")
|
||||
let negQuery = QueryMatchQuery $ mkMatchQuery (FieldName "user") (QueryString "notmyapp")
|
||||
let query = QueryBoostingQuery $ BoostingQuery posQuery negQuery (Boost 0.2)
|
||||
|
||||
#+END_SRC
|
||||
|
||||
**** Rest of the query types
|
||||
|
||||
Just follow the pattern you've seen here and check the Hackage API documentation.
|
||||
|
||||
*** Sorting
|
||||
|
||||
#+BEGIN_SRC haskell
|
||||
|
Loading…
Reference in New Issue
Block a user