Class SiteTextSearchSpanQueryBuilder

  • public class SiteTextSearchSpanQueryBuilder
    extends Object
    Relocation from confluence-search plugin.
    • Constructor Detail

      • SiteTextSearchSpanQueryBuilder

        public SiteTextSearchSpanQueryBuilder()
    • Method Detail

      • getQuery

        public Optional<SearchQuery> getQuery​(String field,
                                              String queryString,
                                              org.apache.lucene.analysis.Analyzer analyzer,
                                              float boost)
        Generates span queries (wrapped in a boolean query if needed) for the given queryString.

        Given the query "one two three" will return the queries SpanNear("one two") OR SpanNear("one three") OR SpanNear("two three")

        Won't generate span queries for more than 6 tokens.

        field - field
        queryString - querystring used to generate the query
        analyzer - analyzer
        boost -
        Query or absent if more than 6 tokens in the queryString