コード例 #1
0
        /// <summary>
        /// Add Document TextCaption to IndexStorage
        /// </summary>
        /// <param name="indexStorage">Index Storage</param>
        /// <param name="textCaption">TextCaption data</param>

        public static void AddDocumentToIndexStorage(IndexStorage indexStorage, TextCaption textCaption)
        {
            Document doc = new Document();

            doc.Add(new Field(FRAME_NAME, textCaption.FrameName, Field.Store.YES, Field.Index.NOT_ANALYZED));
            doc.Add(new Field(TEXT_CAPTION, textCaption.Caption, Field.Store.YES, Field.Index.ANALYZED));

            indexStorage.GetIndexWriter().AddDocument(doc);
        }
コード例 #2
0
        /// <summary>
        /// Add Document To Index Storage
        /// </summary>
        /// <param name="indexStorage">Index Storage</param>
        /// <param name="textSpot">TextSpotting Data</param>
        public static void AddDocumentToIndexStorage(IndexStorage indexStorage, TextSpot textSpot)
        {
            Document doc = new Document();

            doc.Add(new Field(FRAME_NAME, textSpot.FileName, Field.Store.YES, Field.Index.NOT_ANALYZED));
            doc.Add(new Field(TEXT_SPOT, textSpot.Text, Field.Store.YES, Field.Index.ANALYZED));

            indexStorage.GetIndexWriter().AddDocument(doc);
        }