Continue integrating Jayson

This commit is contained in:
Loïc Lecrenier
2022-06-21 14:40:01 +02:00
parent ba82584328
commit b84ea036dd
7 changed files with 49 additions and 110 deletions

View File

@ -8,7 +8,7 @@ use std::sync::Arc;
use fst::IntoStreamer;
use milli::heed::{EnvOpenOptions, RoTxn};
use milli::update::{IndexerConfig, Setting};
use milli::{obkv_to_json, AscDesc, FieldDistribution, Member, DEFAULT_VALUES_PER_FACET};
use milli::{obkv_to_json, FieldDistribution, DEFAULT_VALUES_PER_FACET};
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
use time::OffsetDateTime;
@ -143,11 +143,7 @@ impl Index {
let sortable_attributes = self.sortable_fields(txn)?.into_iter().collect();
let criteria = self
.criteria(txn)?
.into_iter()
.map(|c| AscDesc::Asc(Member::Field("todo".to_string())))
.collect();
let criteria = self.criteria(txn)?;
let stop_words = self
.stop_words(txn)?

View File

@ -5,8 +5,7 @@ use milli::update::{
DocumentAdditionResult, DocumentDeletionResult, IndexDocumentsConfig, IndexDocumentsMethod,
Setting,
};
use milli::{AscDesc, Criterion};
use rayon::vec;
use milli::Criterion;
use serde::{Deserialize, Serialize, Serializer};
use std::collections::{BTreeMap, BTreeSet};
use std::marker::PhantomData;
@ -43,8 +42,8 @@ where
E: jayson::DeserializeError,
{
fn deserialize_from_value<V>(
value: jayson::Value<V>,
location: jayson::ValuePointerRef,
_value: jayson::Value<V>,
_location: jayson::ValuePointerRef,
) -> std::result::Result<Self, E>
where
V: jayson::IntoValue,
@ -147,7 +146,7 @@ pub struct Settings<T> {
#[serde(default, skip_serializing_if = "Setting::is_not_set")]
#[cfg_attr(test, proptest(strategy = "test::setting_strategy()"))]
#[jayson(needs_predicate)]
pub ranking_rules: Setting<Vec<AscDesc>>,
pub ranking_rules: Setting<Vec<Criterion>>,
#[serde(default, skip_serializing_if = "Setting::is_not_set")]
#[cfg_attr(test, proptest(strategy = "test::setting_strategy()"))]
pub stop_words: Setting<BTreeSet<String>>,