packages feed

full-text-search-0.2.2.2: full-text-search.cabal

name:                full-text-search
version:             0.2.2.2
synopsis:            In-memory full text search engine
description:         An in-memory full text search engine library. It lets you
                     run full-text queries on a collection of your documents.
                     .
                     Features:
                     .
                     * Keyword queries and auto-complete\/auto-suggest queries.
                     .
                     * Can search over any type of \"document\".
                       (You explain how to extract search terms from them.)
                     .
                     * Supports documents with multiple fields
                       (e.g. title, body)
                     .
                     * Supports documents with non-term features
                       (e.g. quality score, page rank)
                     .
                     * Uses the state of the art BM25F ranking function
                     .
                     * Adjustable ranking parameters (including field weights
                       and non-term feature scores)
                     .
                     * In-memory but quite compact. It does not keep a copy of
                       your original documents.
                     .
                     * Quick incremental index updates, making it possible to
                       keep your text search in-sync with your data.
                     .
                     It is independent of the document type, so you have to
                     write the document-specific parts: extracting search terms
                     and any stop words, case-normalisation or stemming. This
                     is quite easy using libraries such as
                     <http://hackage.haskell.org/package/tokenize tokenize> and
                     <http://hackage.haskell.org/package/snowball snowball>.
                     .
                     The source package includes a demo to illustrate how to
                     use the library. The demo is a simplified version of how
                     the library is used in the
                     <http://hackage.haskell.org/package/hackage-server hackage-server>
                     where it provides the backend for the package search feature.
bug-reports:         https://github.com/well-typed/full-text-search/issues
license:             BSD3
license-file:        LICENSE
author:              Duncan Coutts
maintainer:          Duncan Coutts <duncan@well-typed.com>,
                     Adam Gundry <adam@well-typed.com>
copyright:           2013-2014 Duncan Coutts, 2014 Well-Typed LLP,
                     2014-2023 IRIS Connect Ltd.
category:            Data, Text, Search
build-type:          Simple
cabal-version:       >=1.10
extra-source-files:  changelog

tested-with:         GHC ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.4 || ==9.6.1

source-repository head
  type:              git
  location:          git@github.com:well-typed/full-text-search.git

flag build-search-demo
  default:           False
  description:       Build a little program illustrating the use of the library
  manual:            True

library
  exposed-modules:     Data.SearchEngine,
                       Data.SearchEngine.BM25F
  other-modules:       Data.SearchEngine.Types,
                       Data.SearchEngine.Update,
                       Data.SearchEngine.Query,
                       Data.SearchEngine.Autosuggest,
                       Data.SearchEngine.SearchIndex,
                       Data.SearchEngine.DocFeatVals,
                       Data.SearchEngine.TermBag,
                       Data.SearchEngine.DocTermIds,
                       Data.SearchEngine.DocIdSet
  other-extensions:    BangPatterns,
                       NamedFieldPuns,
                       RecordWildCards,
                       GeneralizedNewtypeDeriving,
                       ScopedTypeVariables
  build-depends:       base       >=4.5  && <4.19,
                       array      >=0.4  && <0.6,
                       vector     >=0.11 && <0.14,
                       containers >=0.4  && <0.7,
                       text       >=0.11 && <2.1
  default-language:    Haskell2010
  ghc-options:         -Wall -funbox-strict-fields


executable search-demo
  main-is:             Main.hs
  other-modules:       PackageSearch
                       ExtractNameTerms
                       ExtractDescriptionTerms
                       PackageIndexUtils
                       -- support code for package descriptions:
                       HaddockHtml
                       HaddockLex
                       HaddockParse
                       HaddockTypes
  hs-source-dirs:      demo
  if !flag(build-search-demo)
    buildable:         False
  else
    build-depends:     full-text-search,
                       base, text, containers, array,
                       tokenize      >= 0.1,
                       snowball      == 1.0.*,
                       transformers,
                       split         >= 0.2,
                       Cabal         >= 1.14 && < 3,
                       bytestring, filepath, directory, tar, time, mtl
  build-tools:         alex, happy
  default-language:    Haskell2010
  other-extensions:    GeneralizedNewtypeDeriving
  ghc-options:         -Wall

test-suite qc-props
  type:                exitcode-stdio-1.0
  main-is:             Main.hs
  hs-source-dirs:      . tests
  build-depends:       base,
                       array,
                       vector,
                       containers,
                       text,
                       QuickCheck       ==2.*,
                       tasty            >=0.8,
                       tasty-quickcheck >=0.8
  other-modules:       Test.Data.SearchEngine.TermBag,
                       Test.Data.SearchEngine.DocIdSet,
                       Data.SearchEngine.DocTermIds,
                       Data.SearchEngine.DocIdSet,
                       Data.SearchEngine.TermBag
  default-language:    Haskell2010
  ghc-options:         -Wall