C# Class Raven.Database.Indexing.AnonymousObjectToLuceneDocumentConverter

Show file Open project: nhsevidence/ravendb Class Usage Examples

Public Methods

Method Description
AnonymousObjectToLuceneDocumentConverter ( Raven.Database.Indexing.IndexDefinition indexDefinition ) : System
Index ( RavenJObject document, Raven.Database.Indexing.IndexDefinition indexDefinition, Field defaultStorage ) : IEnumerable
Index ( object val, PropertyDescriptorCollection properties, Raven.Database.Indexing.IndexDefinition indexDefinition, Field defaultStorage ) : IEnumerable

Private Methods

Method Description
CreateFieldWithCaching ( string name, string value, Field store, Field index ) : Field
CreateFields ( string name, object value, Raven.Database.Indexing.IndexDefinition indexDefinition, Field defaultStorage ) : IEnumerable

This method generate the fields for indexing documents in lucene from the values. Given a name and a value, it has the following behavior: * If the value is enumerable, index all the items in the enumerable under the same field name * If the value is null, create a single field with the supplied name with the unanalyzed value 'NULL_VALUE' * If the value is string or was set to not analyzed, create a single field with the supplied name * If the value is date, create a single field with millisecond precision with the supplied name * If the value is numeric (int, long, double, decimal, or float) will create two fields: 1. with the supplied name, containing the numeric value as an unanalyzed string - useful for direct queries 2. with the name: name +'_Range', containing the numeric value in a form that allows range queries

CreateNumericFieldWithCaching ( string name, object value, Field defaultStorage ) : IEnumerable
GetPropertyValue ( RavenJToken property ) : object
ShouldTreatAsEnumerable ( IEnumerable itemsToIndex ) : bool

Method Details

AnonymousObjectToLuceneDocumentConverter() public method

public AnonymousObjectToLuceneDocumentConverter ( Raven.Database.Indexing.IndexDefinition indexDefinition ) : System
indexDefinition Raven.Database.Indexing.IndexDefinition
return System

Index() public method

public Index ( RavenJObject document, Raven.Database.Indexing.IndexDefinition indexDefinition, Field defaultStorage ) : IEnumerable
document RavenJObject
indexDefinition Raven.Database.Indexing.IndexDefinition
defaultStorage Lucene.Net.Documents.Field
return IEnumerable

Index() public method

public Index ( object val, PropertyDescriptorCollection properties, Raven.Database.Indexing.IndexDefinition indexDefinition, Field defaultStorage ) : IEnumerable
val object
properties System.ComponentModel.PropertyDescriptorCollection
indexDefinition Raven.Database.Indexing.IndexDefinition
defaultStorage Lucene.Net.Documents.Field
return IEnumerable