pub fn index_value(
    indexer: &mut RawIndexer,
    document_id: DocumentId,
    indexed_pos: IndexedPos,
    value: &Value,
) -> Option<usize>
{
    match value {
        Value::Null => None,
        Value::Bool(boolean) => {
            let text = boolean.to_string();
            let number_of_words = indexer.index_text(document_id, indexed_pos, &text);
            Some(number_of_words)
        },
        Value::Number(number) => {
            let text = number.to_string();
            Some(indexer.index_text(document_id, indexed_pos, &text))
        },
        Value::String(string) => {
            Some(indexer.index_text(document_id, indexed_pos, &string))
        },
        Value::Array(_) => {
            let text = value_to_string(value);
            Some(indexer.index_text(document_id, indexed_pos, &text))
        },
        Value::Object(_) => {
            let text = value_to_string(value);
            Some(indexer.index_text(document_id, indexed_pos, &text))
        },
    }
}
/// Returns the number of words indexed or `None` if the type is unindexable.
Returns the number of words indexed or `None` if the type is unindexable.
Returns the number of words indexed or ` None ` if the type is unindexable .
pub fn index_value(
    indexer: &mut RawIndexer,
    document_id: DocumentId,
    indexed_pos: IndexedPos,
    value: &Value,
) -> Option<usize>
{
    match value {
        Value::Null => None,
        Value::Bool(boolean) => {
            let text = boolean.to_string();
            let number_of_words = indexer.index_text(document_id, indexed_pos, &text);
            Some(number_of_words)
        },
        Value::Number(number) => {
            let text = number.to_string();
            Some(indexer.index_text(document_id, indexed_pos, &text))
        },
        Value::String(string) => {
            Some(indexer.index_text(document_id, indexed_pos, &string))
        },
        Value::Array(_) => {
            let text = value_to_string(value);
            Some(indexer.index_text(document_id, indexed_pos, &text))
        },
        Value::Object(_) => {
            let text = value_to_string(value);
            Some(indexer.index_text(document_id, indexed_pos, &text))
        },
    }
}
pub fn index_value ( indexer : & mut RawIndexer , document_id : DocumentId , indexed_pos : IndexedPos , value : & Value , ) -> Option < usize > { match value { Value :: Null => None , Value :: Bool ( boolean ) => { let text = boolean . to_string ( ) ; let number_of_words = indexer . index_text ( document_id , indexed_pos , & text ) ; Some ( number_of_words ) } , Value :: Number ( number ) => { let text = number . to_string ( ) ; Some ( indexer . index_text ( document_id , indexed_pos , & text ) ) } , Value :: String ( string ) => { Some ( indexer . index_text ( document_id , indexed_pos , & string ) ) } , Value :: Array ( _ ) => { let text = value_to_string ( value ) ; Some ( indexer . index_text ( document_id , indexed_pos , & text ) ) } , Value :: Object ( _ ) => { let text = value_to_string ( value ) ; Some ( indexer . index_text ( document_id , indexed_pos , & text ) ) } , } }
Returns the number of words indexed or `None` if the type is unindexable.
Returns the number of words indexed or ` None ` if the type is unindexable .
indexer
&mut RawIndexer
document_id
DocumentId
indexed_pos
IndexedPos
value
&Value
indexer
&mut RawIndexer
document_id
DocumentId
indexed_pos
IndexedPos
value
&Value