public void Set(String name, Object value, Document document, Field.Store store)
        {
            string indexedString = stringBridge.ObjectToString(value);

            // Do not add fields on empty strings, seems a sensible default in most situations
            // TODO if Store, probably also save empty ones
            if (StringHelper.IsNotEmpty(indexedString))
            {
                var field = new StringField(name, indexedString, store);

                document.Add(field);
            }
        }
Beispiel #2
0
        public void Set(String name, Object value, Document document, Field.Store store, Field.Index index, float?boost)
        {
            string indexedString = stringBridge.ObjectToString(value);

            // Do not add fields on empty strings, seems a sensible default in most situations
            // TODO if Store, probably also save empty ones
            if (StringHelper.IsNotEmpty(indexedString))
            {
                Field field = new Field(name, indexedString, store, index);
                if (boost != null)
                {
                    field.Boost = boost.Value;
                }

                document.Add(field);
            }
        }