Example #1
0
 public IndexFieldInfo(string name, string value, FieldInfoType type, Field.Store store, Field.Index index, Field.TermVector termVector)
 {
     Name       = name;
     Value      = value;
     Type       = type;
     Store      = store;
     Index      = index;
     TermVector = termVector;
 }
Example #2
0
 /// <summary>
 /// Process Field
 /// </summary>
 /// <param name="doc">
 /// The doc.
 /// </param>
 /// <param name="fieldKey">
 /// The field key.
 /// </param>
 /// <param name="fieldValue">
 /// The field value.
 /// </param>
 /// <param name="storage">
 /// The storage.
 /// </param>
 /// <param name="index">
 /// The index.
 /// </param>
 /// <param name="vector">
 /// The vector.
 /// </param>
 /// <param name="boost">
 /// The boost.
 /// </param>
 protected virtual void ProcessField(Document doc, string fieldKey, string fieldValue, LuceneField.Store storage, LuceneField.Index index, LuceneField.TermVector vector, float boost)
 {
     if ((!fieldKey.IsNullOrEmpty() && !fieldValue.IsNullOrEmpty()) &&
         (index != LuceneField.Index.NO || storage != LuceneField.Store.NO))
     {
         doc.Add(CreateField(fieldKey, fieldValue.ToLowerInvariant(), storage, index, vector, boost));
     }
 }
Example #3
0
 /// <summary>
 /// Process Field
 /// </summary>
 /// <param name="doc">
 /// The doc.
 /// </param>
 /// <param name="fieldKey">
 /// The field key.
 /// </param>
 /// <param name="fieldValue">
 /// The field value.
 /// </param>
 /// <param name="storage">
 /// The storage.
 /// </param>
 /// <param name="index">
 /// The index.
 /// </param>
 /// <param name="vector">
 /// The vector.
 /// </param>
 protected virtual void ProcessField(Document doc, string fieldKey, string fieldValue, LuceneField.Store storage, LuceneField.Index index, LuceneField.TermVector vector)
 {
     this.ProcessField(doc, fieldKey, fieldValue, storage, index, vector, 1f);
 }
Example #4
0
        /// <summary>
        /// Create a Field
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <param name="value">
        /// The value.
        /// </param>
        /// <param name="storageType">
        /// The storage type.
        /// </param>
        /// <param name="indexType">
        /// The index type.
        /// </param>
        /// <param name="vectorType">
        /// The vector type.
        /// </param>
        /// <param name="boost">
        /// The boost.
        /// </param>
        /// <returns>
        /// Abstract Field
        /// </returns>
        protected AbstractField CreateField(string name, string value, LuceneField.Store storageType, LuceneField.Index indexType, LuceneField.TermVector vectorType, float boost)
        {
            var field = new LuceneField(name, value, storageType, indexType, vectorType);

            field.SetBoost(boost);
            return(field);
        }
 protected virtual void ProcessField(Document doc, string fieldKey, string fieldValue, LuceneField.Store storage, LuceneField.Index index)
 {
     ProcessField(doc, fieldKey, fieldValue, storage, index, LuceneField.TermVector.NO);
 }
Example #6
0
 public void AddField(string name, string value, Field.Store store, Field.Index index, Field.TermVector termVector)
 {
     fields.Add(new IndexFieldInfo(name, value, FieldInfoType.StringField, store, index, termVector));
 }
Example #7
0
 public void AddField(string name, string value, Field.Store store, Field.Index index)
 {
     AddField(name, value, store, index, Field.TermVector.NO);
 }