![]() Values yourself with only as much precision as you require. NOTE: In most all cases this will be rather inefficient, GetDoubles(AtomicReader, String, Boolean). Per-document double values can be retrieved via Syntactic sugar for encoding doubles as NumericDocValues This is a Lucene.NET EXPERIMENTAL API, use at your own risk DoubleDocValuesField This is used by Document(Int32) to load a ![]() Requested fields provided to DocumentStoredFieldVisitor(ISet). DocumentStoredFieldVisitorĭocument containing all stored fields, or only specific Not available in documents retrieved from the index, e.g. Note that fields which are not IsStored are Should typically contain one or more stored fields which uniquely identify ![]() Each field has a name and a textual value.Ī field may be stored ( IsStored) with the document, in whichĬase it is returned with search hits on the document. Here's an example usage: document.Add(new DerefBytesDocValuesField(name, new BytesRef("hello"))) ĭocuments are the unit of indexing and search.Ī Document is a set of fields. This as a numeric value with Int64Field and use NumericRangeQueryĪ per-document BytesRef value. TermRangeQuery and PrefixQuery will require more memory and become slower.Īnother approach is NumericUtils, which providesĪ sortable binary representation (prefix encoded) of numeric values, whichįor indexing a System.DateTime, just get the and index Save dates with a finer resolution than you really need, as then This class also helps you to limit the resolution of your dates. Them by date, which makes them suitable for use as field values The strings are structured so that lexicographic sorting orders Provides support for converting dates to strings and vice-versa. This class uses the System.IO.Compression.DeflateStreamĬlass to compress and decompress. Simple utility class providing static methods toĬompress and decompress binary data for stored fields. Here's an example usage: document.Add(new ByteDocValuesField(name, (byte) 22)) ByteDocValuesFieldįield that stores a per-document System.Byte value for scoring, If you also need to store the value, you should add a Here's an example usage: document.Add(new BinaryDocValuesField(name, new BytesRef("hello"))) May be shared and sorted it's better to use SortedDocValuesField. ![]() The fields don't share (many) values, such as a title field. The values are stored directly with no sharing, which is a good fit when Int32Field, Int64Field, SingleField and DoubleField are a special helper class to simplify indexing of numeric values (and also dates) for fast range range queries with NumericRangeQuery (using a special sortable string representation of numeric values).įield that stores a per-document BytesRef value. The DateTools is a utility class to make dates and times searchable (remember, Lucene only searches text). That being said, there are many tools available in other projects that can make the process of taking a file and converting it into a Lucene Document. It is your job to create Documents based on the content of the files you are working with in your application (Word, txt, PDF, Excel or any other format.) How this is done is completely up to you. Working with Documentsįirst and foremost, a Document is something created by the user application. Note: it is common to refer to Documents having Fields, even though technically they have IIndexableFields. Apache lucene doc how to#IIndexableFields have a number of properties that tell Lucene.NET how to treat the content (like indexed, tokenized, stored, etc.) See the Field implementation of IIndexableField for specifics on these properties. A IIndexableField is a logical representation of a user's content that needs to be indexed or stored. Document and IndexableFieldĪ Document is a collection of IIndexableFields. ![]() The package also provides utilities for working with Documents and IIndexableFields. The document package provides the user level logical representation of content to be indexed and searched.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |