Class LuceneSiteTextSearchSpanQueryBuilder


  • public class LuceneSiteTextSearchSpanQueryBuilder
    extends Object
    Relocation from confluence-search plugin.
    Since:
    6.16.0
    • Constructor Detail

      • LuceneSiteTextSearchSpanQueryBuilder

        public LuceneSiteTextSearchSpanQueryBuilder()
    • Method Detail

      • getQuery

        public com.google.common.base.Optional<org.apache.lucene.search.Query> getQuery​(String field,
                                                                                        String queryString,
                                                                                        org.apache.lucene.analysis.Analyzer analyzer)
        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.

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