Esempio n. 1
0
        /// <summary> Retrieve the term vector for the given document and field</summary>
        /// <param name="docNum">The document number to retrieve the vector for
        /// </param>
        /// <param name="field">The field within the document to retrieve
        /// </param>
        /// <returns> The TermFreqVector for the document and field or null if there is no termVector for this field.
        /// </returns>
        /// <throws>  IOException if there is an error reading the term vector files </throws>
        public /*internal*/ virtual TermFreqVector Get(int docNum, System.String field)
        {
            // Check if no term vectors are available for this segment at all
            ParallelArrayTermVectorMapper mapper = new ParallelArrayTermVectorMapper();

            Get(docNum, field, mapper);

            return(mapper.MaterializeVector());
        }
Esempio n. 2
0
 private SegmentTermVector[] ReadTermVectors(int docNum, System.String[] fields, long[] tvfPointers)
 {
     SegmentTermVector[] res = new SegmentTermVector[fields.Length];
     for (int i = 0; i < fields.Length; i++)
     {
         ParallelArrayTermVectorMapper mapper = new ParallelArrayTermVectorMapper();
         mapper.SetDocumentNumber(docNum);
         ReadTermVector(fields[i], tvfPointers[i], mapper);
         res[i] = (SegmentTermVector)mapper.MaterializeVector();
     }
     return(res);
 }
Esempio n. 3
0
		private SegmentTermVector[] ReadTermVectors(int docNum, System.String[] fields, long[] tvfPointers)
		{
			SegmentTermVector[] res = new SegmentTermVector[fields.Length];
			for (int i = 0; i < fields.Length; i++)
			{
				ParallelArrayTermVectorMapper mapper = new ParallelArrayTermVectorMapper();
				mapper.SetDocumentNumber(docNum);
				ReadTermVector(fields[i], tvfPointers[i], mapper);
				res[i] = (SegmentTermVector) mapper.MaterializeVector();
			}
			return res;
		}
Esempio n. 4
0
		/// <summary> Retrieve the term vector for the given document and field</summary>
		/// <param name="docNum">The document number to retrieve the vector for
		/// </param>
		/// <param name="field">The field within the document to retrieve
		/// </param>
		/// <returns> The TermFreqVector for the document and field or null if there is no termVector for this field.
		/// </returns>
		/// <throws>  IOException if there is an error reading the term vector files </throws>
		public /*internal*/ virtual TermFreqVector Get(int docNum, System.String field)
		{
			// Check if no term vectors are available for this segment at all
			ParallelArrayTermVectorMapper mapper = new ParallelArrayTermVectorMapper();
			Get(docNum, field, mapper);
			
			return mapper.MaterializeVector();
		}