Class SimpleDocument

    • Field Detail

      • DATEFORMAT

        public static final org.apache.commons.lang3.time.FastDateFormat DATEFORMAT
    • Constructor Detail

      • SimpleDocument

        public SimpleDocument()
      • SimpleDocument

        public SimpleDocument​(float score)
    • Method Detail

      • getAdditionalFields

        public Iterable<org.apache.lucene.index.IndexableField> getAdditionalFields()
        Description copied from interface: Document
        Returns some additionally IndexableFields (if any) to be added to the Document which is being created from this Document.
        Specified by:
        getAdditionalFields in interface Document
        Returns:
        some IndexableFields
      • addField

        public void addField​(org.apache.lucene.index.IndexableField field)
      • getField

        public org.apache.lucene.index.IndexableField getField​(String name)
        Specified by:
        getField in interface Document
      • setLanguage

        public void setLanguage​(String language)
      • getType

        public String getType()
        Description copied from interface: Document
        Returns the type of this Document, to be used when searching Documents of a certain type.
        Specified by:
        getType in interface Document
        Returns:
        the type
      • setType

        public void setType​(String type)
      • getContent

        public String getContent()
        Description copied from interface: Document
        Returns the content to be indexed.
        Specified by:
        getContent in interface Document
        Returns:
        the content to be indexed
      • setContent

        public void setContent​(String content)
      • setPath

        public void setPath​(String path)
      • setImage

        public void setImage​(String image)
      • setDescription

        public void setDescription​(String description)
      • setDate

        public void setDate​(Date date)
      • setName

        public void setName​(String name)
      • getId

        public String getId()
        Description copied from interface: Document
        Returns the ID of this Document.
        Has to be globally unique, speaking in the scope of a Site, since each site has it's own searchindex.
        Specified by:
        getId in interface Document
        Returns:
        the ID
      • setId

        public void setId​(String id)
      • getDocId

        public int getDocId()
        Specified by:
        getDocId in interface Document
      • setDocId

        public void setDocId​(int docId)
      • getScore

        public float getScore()
        Specified by:
        getScore in interface Document
      • setScore

        public void setScore​(float score)
      • extract

        public static SimpleDocument extract​(org.apache.lucene.document.Document doc,
                                             int docId,
                                             float score)
      • getNumberFromField

        protected static Number getNumberFromField​(org.apache.lucene.document.Document doc,
                                                   String name,
                                                   List<org.apache.lucene.index.IndexableField> fieldsList)
      • setFragment

        public void setFragment​(String field,
                                org.apache.lucene.analysis.Analyzer analyzer,
                                org.apache.lucene.search.Query query,
                                String highlightWith)
      • setFragment

        public static void setFragment​(SimpleDocument doc,
                                       String field,
                                       org.apache.lucene.analysis.Analyzer analyzer,
                                       org.apache.lucene.search.Query query,
                                       String highlightWith)