All properties

Every property spring_search_dart reads, under spring.search. They are bound once, when the searchService bean is created; a change takes a restart of the context (in Flutter, a hot reload restarts it).

Why

The search is mostly configuration: where the documents are, how the fields weigh, how forgiving it is. This page lists every key in one place; the package's metadata describes the same keys for editors.

Example

# lib/resources/application.yml
spring:
  search:
    enabled: true
    default-language: en
    operator: and
    fuzzy: 1
    max-hits: 20
    collapse-by: page
    fields:
      title: 8
      heading: 4
      body: 1
    analyzers:
      ja: standard
      fr: french          # a SearchAnalyzer bean named french
    markdown:
      - location: resources:content/components/**/*.md
        exclude: ['**/contents*.md']
        link: /components/{path}
      - location: resources:content/docs/**/*.md
        exclude: ['**/contents*.md']
        link: /docs/{path}

spring.search

Key Type Default Meaning Page
spring.search.enabled bool true false: no SearchService bean Overview
spring.search.default-language language tag en The language of the documents that name none, and of a search that names none or one without documents Documents
spring.search.operator and, or and and: a document has every word of the query; or: one of them Searching
spring.search.fuzzy number 1 The typos a word of the query may have: one for a word of five to seven letters, up to this many for a longer one; 0: none Searching
spring.search.max-hits number 20 The most hits a search gives (a search's limit: overrides it) Searching
spring.search.collapse-by attribute name none The attribute that groups the hits: only the best of each value stays (page: one section per page) Searching
spring.search.indexing first-search, start, background first-search When the indexes are built: at the first search (or SearchService.prepare()), while the application starts (behind a Flutter app's splash), or right after it while the app runs Searching
spring.search.prebuilt boolean true The build writes the index of spring.search.markdown, a file per language in lib/resources/spring_gen/search/ (a Flutter asset), and the search reads it instead of the pages Searching
spring.search.fields.<field> number empty: title 8, heading 4, body 1 The weight of each field; a field not named weighs 1. Setting any field replaces the defaults Searching
spring.search.analyzers.<language> analyzer name english for en, standard for the others The analyzer of each language (ja: standard) Analyzers
spring.search.markdown[n].location resources: or asset: pattern required The Markdown files (resources:content/**/*.md, asset:docs/**/*.md) Documents
spring.search.markdown[n].exclude list of patterns none Files to leave out, relative to the location's directory (**/contents*.md) Documents
spring.search.markdown[n].link text with {path} /{path} The link of a page: {path} is the file's path from the location's directory, without .md, its language and a last index Documents

See also