Interface CategoryEnhancement

    • Method Detail

      • getCategoryTokenBytes

        byte[] getCategoryTokenBytes​(CategoryAttribute categoryAttribute)
        Get the bytes to be added to the category token payload for this enhancement.

        NOTE: The returned array is copied, it is recommended to allocate a new one each time.

        The bytes generated by this method are the input of extractCategoryTokenData(byte[], int, int).

        Parameters:
        categoryAttribute - The attribute of the category.
        Returns:
        The bytes to be added to the category token payload for this enhancement.
      • extractCategoryTokenData

        Object extractCategoryTokenData​(byte[] buffer,
                                        int offset,
                                        int length)
        Get the data of this enhancement from a category token payload.

        The input bytes for this method are generated in getCategoryTokenBytes(CategoryAttribute).

        Parameters:
        buffer - The payload buffer.
        offset - The offset of this enhancement's data in the buffer.
        length - The length of this enhancement's data (bytes).
        Returns:
        An Object containing the data.
      • generatesCategoryList

        boolean generatesCategoryList()
        Declarative method to indicate whether this enhancement generates separate category list.
        Returns:
        true if generates category list, else false.
      • getCategoryListTermText

        String getCategoryListTermText()
        Returns the text of this enhancement's category list term.
        Returns:
        The text of this enhancement's category list term.
      • getCategoryListTokenizer

        CategoryListTokenizer getCategoryListTokenizer​(org.apache.lucene.analysis.TokenStream tokenizer,
                                                       EnhancementsIndexingParams indexingParams,
                                                       TaxonomyWriter taxonomyWriter)
        Get the CategoryListTokenizer which generates the category list for this enhancement. If generatesCategoryList() returns false this method will not be called.
        Parameters:
        tokenizer - The input stream containing categories.
        indexingParams - The indexing params to use.
        taxonomyWriter - The taxonomy to add categories and get their ordinals.
        Returns:
        A CategoryListTokenizer generating the category list for this enhancement, with tokenizer as it's input.