Interface LuceneSearchEnginePolicyFilter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void filterCategoryDocument​(org.apache.lucene.document.Document doc, Category cat, java.lang.String lang)
      This method is called when the given Category is being index in the given language, just before writing the Document into the index.
      void filterMemberDocument​(org.apache.lucene.document.Document doc, Member mbr)
      This method is called when the given Member is being index, just before writing the Document into the index.
      void filterPublicationDocument​(org.apache.lucene.document.Document doc, Publication pub, java.lang.String lang)
      This method is called when the given Publication is being index in the given language, just before writing the Document into the index.
      org.apache.lucene.analysis.Analyzer getAnalyzer​(java.lang.String lang, boolean isIndexing, org.apache.lucene.analysis.Analyzer analyzer)
      Return the Lucene Analyzer to use for a given language.
      java.util.HashSet<java.lang.String> getLanguageStopWordsSet​(java.lang.String lang, java.util.HashSet<java.lang.String> jcms)
      Retrieves stop words of the specified language.
      org.apache.lucene.search.Query parseQuery​(java.lang.String searchString, ParseOptions options, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.Query query)
      Parse the specified search string into a Lucene Query.
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Method Detail

      • getLanguageStopWordsSet

        java.util.HashSet<java.lang.String> getLanguageStopWordsSet​(java.lang.String lang,
                                                                    java.util.HashSet<java.lang.String> jcms)
        Retrieves stop words of the specified language.
        Parameters:
        lang - a ISO-639 language code
        jcms - the default Set stop word configured in JCMS
        Returns:
        a Set of stop words String
      • getAnalyzer

        org.apache.lucene.analysis.Analyzer getAnalyzer​(java.lang.String lang,
                                                        boolean isIndexing,
                                                        org.apache.lucene.analysis.Analyzer analyzer)
        Return the Lucene Analyzer to use for a given language.
        Parameters:
        lang - the ISO-639 code of the language analyzed
        isIndexing - true if the returned anallyzer is to be used for indexing, false in any other case (e.g. during search etc..) You may want to use this parameter to change the behaviour of your analyzer during those case (for example, synonym analyzer must generate synonyms only when indexing, not during search).
        analyzer - the internal Analyzer, created by JCMS, that should be returned if you do not want to return a customize analyzer
        Returns:
        a new Analyzer
      • filterPublicationDocument

        void filterPublicationDocument​(org.apache.lucene.document.Document doc,
                                       Publication pub,
                                       java.lang.String lang)
        This method is called when the given Publication is being index in the given language, just before writing the Document into the index. You can use this hook to modify the Document as you wish by adding or removing field.
        Parameters:
        doc - the lucene Document that was created by JCMS search engine
        pub - the Publication being indexed
        lang - the indexed language
        See Also:
        LucenePublicationSearchEngine
      • filterCategoryDocument

        void filterCategoryDocument​(org.apache.lucene.document.Document doc,
                                    Category cat,
                                    java.lang.String lang)
        This method is called when the given Category is being index in the given language, just before writing the Document into the index. You can use this hook to modify the Document as you wish by adding or removing field.
        Parameters:
        doc - the lucene Document that was created by JCMS search engine
        cat - the Category being indexed
        lang - the indexed language
        See Also:
        LuceneCategorySearchEngine
      • filterMemberDocument

        void filterMemberDocument​(org.apache.lucene.document.Document doc,
                                  Member mbr)
        This method is called when the given Member is being index, just before writing the Document into the index. You can use this hook to modify the Document as you wish by adding or removing field.
        Parameters:
        doc - the lucene Document that was created by JCMS search engine
        mbr - the Member being indexed
        Since:
        jcms-7.0.0
        See Also:
        LuceneMemberSearchEngine
      • parseQuery

        org.apache.lucene.search.Query parseQuery​(java.lang.String searchString,
                                                  ParseOptions options,
                                                  org.apache.lucene.analysis.Analyzer analyzer,
                                                  org.apache.lucene.search.Query query)
                                           throws org.apache.lucene.queryparser.classic.ParseException
        Parse the specified search string into a Lucene Query.
        Parameters:
        searchString - the string to be search
        options - current parsing option
        analyzer - the analyzer being used for this search
        query - a Query instance already computed by other policy if any (may be null)
        Returns:
        a new Query, return null to use default JCMS behavior
        Throws:
        org.apache.lucene.queryparser.classic.ParseException - on parse error
        Since:
        jcms-10.0.0