mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-23 02:29:57 +00:00
add index sorting deprecation warning (#2353)
* add index sorting deprecation warning * remove deprecated IntOptions and DatePrecision
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#![allow(deprecated)]
|
||||
|
||||
use std::fmt;
|
||||
use std::io::{Read, Write};
|
||||
|
||||
@@ -27,9 +25,6 @@ pub enum DateTimePrecision {
|
||||
Nanoseconds,
|
||||
}
|
||||
|
||||
#[deprecated(since = "0.20.0", note = "Use `DateTimePrecision` instead")]
|
||||
pub type DatePrecision = DateTimePrecision;
|
||||
|
||||
/// A date/time value with nanoseconds precision.
|
||||
///
|
||||
/// This timestamp does not carry any explicit time zone information.
|
||||
|
||||
@@ -15,8 +15,6 @@ mod vint;
|
||||
mod writer;
|
||||
pub use bitset::*;
|
||||
pub use byte_count::ByteCount;
|
||||
#[allow(deprecated)]
|
||||
pub use datetime::DatePrecision;
|
||||
pub use datetime::{DateTime, DateTimePrecision};
|
||||
pub use group_by::GroupByIteratorExtended;
|
||||
pub use json_path_writer::JsonPathWriter;
|
||||
|
||||
@@ -83,7 +83,7 @@ fn save_new_metas(
|
||||
///
|
||||
/// ```
|
||||
/// use tantivy::schema::*;
|
||||
/// use tantivy::{Index, IndexSettings, IndexSortByField, Order};
|
||||
/// use tantivy::{Index, IndexSettings};
|
||||
///
|
||||
/// let mut schema_builder = Schema::builder();
|
||||
/// let id_field = schema_builder.add_text_field("id", STRING);
|
||||
@@ -96,10 +96,7 @@ fn save_new_metas(
|
||||
///
|
||||
/// let schema = schema_builder.build();
|
||||
/// let settings = IndexSettings{
|
||||
/// sort_by_field: Some(IndexSortByField{
|
||||
/// field: "number".to_string(),
|
||||
/// order: Order::Asc
|
||||
/// }),
|
||||
/// docstore_blocksize: 100_000,
|
||||
/// ..Default::default()
|
||||
/// };
|
||||
/// let index = Index::builder().schema(schema).settings(settings).create_in_ram();
|
||||
|
||||
@@ -288,6 +288,10 @@ impl Default for IndexSettings {
|
||||
/// Presorting documents can greatly improve performance
|
||||
/// in some scenarios, by applying top n
|
||||
/// optimizations.
|
||||
#[deprecated(
|
||||
since = "0.22.0",
|
||||
note = "We plan to remove index sorting in `0.23`. If you need index sorting, please comment on the related issue https://github.com/quickwit-oss/tantivy/issues/2352 and explain your use case."
|
||||
)]
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
|
||||
pub struct IndexSortByField {
|
||||
/// The field to sort the documents by
|
||||
|
||||
@@ -178,6 +178,7 @@ pub use crate::future_result::FutureResult;
|
||||
pub type Result<T> = std::result::Result<T, TantivyError>;
|
||||
|
||||
mod core;
|
||||
#[allow(deprecated)] // Remove with index sorting
|
||||
pub mod indexer;
|
||||
|
||||
#[allow(unused_doc_comments)]
|
||||
@@ -189,6 +190,7 @@ pub mod collector;
|
||||
pub mod directory;
|
||||
pub mod fastfield;
|
||||
pub mod fieldnorm;
|
||||
#[allow(deprecated)] // Remove with index sorting
|
||||
pub mod index;
|
||||
pub mod positions;
|
||||
pub mod postings;
|
||||
@@ -223,6 +225,7 @@ pub use self::snippet::{Snippet, SnippetGenerator};
|
||||
pub use crate::core::json_utils;
|
||||
pub use crate::core::{Executor, Searcher, SearcherGeneration};
|
||||
pub use crate::directory::Directory;
|
||||
#[allow(deprecated)] // Remove with index sorting
|
||||
pub use crate::index::{
|
||||
Index, IndexBuilder, IndexMeta, IndexSettings, IndexSortByField, InvertedIndexReader, Order,
|
||||
Segment, SegmentComponent, SegmentId, SegmentMeta, SegmentReader,
|
||||
@@ -234,8 +237,6 @@ pub use crate::index::{
|
||||
pub use crate::indexer::PreparedCommit;
|
||||
pub use crate::indexer::{IndexWriter, SingleSegmentIndexWriter};
|
||||
pub use crate::postings::Postings;
|
||||
#[allow(deprecated)]
|
||||
pub use crate::schema::DatePrecision;
|
||||
pub use crate::schema::{DateOptions, DateTimePrecision, Document, TantivyDocument, Term};
|
||||
|
||||
/// Index format version.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
use std::ops::BitOr;
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub use common::DatePrecision;
|
||||
pub use common::DateTimePrecision;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ pub enum ValueType {
|
||||
/// A dynamic object value.
|
||||
Object,
|
||||
/// A JSON object value. Deprecated.
|
||||
#[deprecated]
|
||||
#[deprecated(note = "We keep this for backwards compatibility, use Object instead")]
|
||||
JSONObject,
|
||||
}
|
||||
|
||||
|
||||
@@ -130,8 +130,6 @@ mod text_options;
|
||||
use columnar::ColumnType;
|
||||
|
||||
pub use self::bytes_options::BytesOptions;
|
||||
#[allow(deprecated)]
|
||||
pub use self::date_time_options::DatePrecision;
|
||||
pub use self::date_time_options::{DateOptions, DateTimePrecision, DATE_TIME_PRECISION_INDEXED};
|
||||
pub use self::document::{DocParsingError, Document, OwnedValue, TantivyDocument, Value};
|
||||
pub(crate) use self::facet::FACET_SEP_BYTE;
|
||||
@@ -146,8 +144,6 @@ pub use self::index_record_option::IndexRecordOption;
|
||||
pub use self::ip_options::{IntoIpv6Addr, IpAddrOptions};
|
||||
pub use self::json_object_options::JsonObjectOptions;
|
||||
pub use self::named_field_document::NamedFieldDocument;
|
||||
#[allow(deprecated)]
|
||||
pub use self::numeric_options::IntOptions;
|
||||
pub use self::numeric_options::NumericOptions;
|
||||
pub use self::schema::{Schema, SchemaBuilder};
|
||||
pub use self::term::{Term, ValueBytes, JSON_END_OF_PATH};
|
||||
|
||||
@@ -5,10 +5,6 @@ use serde::{Deserialize, Serialize};
|
||||
use super::flags::CoerceFlag;
|
||||
use crate::schema::flags::{FastFlag, IndexedFlag, SchemaFlagList, StoredFlag};
|
||||
|
||||
#[deprecated(since = "0.17.0", note = "Use NumericOptions instead.")]
|
||||
/// Deprecated use [`NumericOptions`] instead.
|
||||
pub type IntOptions = NumericOptions;
|
||||
|
||||
/// Define how an `u64`, `i64`, or `f64` field should be handled by tantivy.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[serde(from = "NumericOptionsDeser")]
|
||||
|
||||
Reference in New Issue
Block a user