git.iko.soy/typeable/bloodhound
on master help sign in
Updated documentation
42b0e92John Galt
README.md+15−2
@@ -383,7 +383,7 @@ Search
383
383
384-- exported by the Client module, just defaults some stuff.
384-- exported by the Client module, just defaults some stuff.
385-- mkSearch :: Maybe Query -> Maybe Filter -> Search
385-- mkSearch :: Maybe Query -> Maybe Filter -> Search
386−-- mkSearch query filter = Search query filter Nothing False (From 0) (Size 10)
386+-- mkSearch query filter = Search query filter Nothing False (From 0) (Size 10) Nothing
387
387
388let query = TermQuery (Term "user" "bitemyapp") Nothing
388let query = TermQuery (Term "user" "bitemyapp") Nothing
389
389
@@ -486,9 +486,22 @@ let sortSpec = DefaultSortSpec $ mkSort (FieldName "age") Ascending
486-- -> Maybe Sort
486-- -> Maybe Sort
487-- -> TrackSortScores
487-- -> TrackSortScores
488-- -> From -> Size
488-- -> From -> Size
489+-- -> Maybe [FieldName]
489
490
490-- just add more sortspecs to the list if you want tie-breakers.
491-- just add more sortspecs to the list if you want tie-breakers.
491−let search = Search Nothing (Just IdentityFilter) (Just [sortSpec]) False (From 0) (Size 10)
492+let search = Search Nothing (Just IdentityFilter) (Just [sortSpec]) False (From 0) (Size 10) Nothing
493+
494+```
495+
496+### Field selection
497+
498+If you only want certain fields from the source document returned, you can
499+set the "fields" field of the Search record.
500+
501+``` {.haskell}
502+
503+let search' = mkSearch (Just (MatchAllQuery Nothing)) Nothing
504+ search = search' { fields = Just [FieldName "updated"] }
492
505
493```
506```
494
507