git.iko.soy/typeable/bloodhound
on master help sign in
Updated documentation
commit42b0e928212a41ab6cc9f7790cdbf19ebad0de5b authorJohn Galt <centromere@users.noreply.github.com> dateThu 23 Jul 2015, 17:51 (11 years ago) parent72c1939
1 file changed+15−2
README.md+15−2
README.md+15−2
@@ -383,7 +383,7 @@ Search
383383
384384-- exported by the Client module, just defaults some stuff.
385385-- 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
387387
388388let query = TermQuery (Term "user" "bitemyapp") Nothing
389389
@@ -486,9 +486,22 @@ let sortSpec = DefaultSortSpec $ mkSort (FieldName "age") Ascending
486486-- -> Maybe Sort
487487-- -> TrackSortScores
488488-- -> From -> Size
489+-- -> Maybe [FieldName]
489490
490491-- 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"] }
492505
493506```
494507