You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: query_string.rs
    path of file: ./repos/bayard/bayard/src/search/query
    
    the code of the file until where you have to start completion: use tantivy::{
    query::{Query, QueryParser},
    schema::Field,
    Searcher,
};

use super::{QueryFactoryError, QueryFactoryErrorKind};

#[derive(Deserialize, Serialize)]
pub struct QueryStringQueryArgs {
    query: String,
    default_search_fields: Vec<String>,
}

/// Create a query string query.
pub fn create_query_string_query(
    args: &QueryStringQueryArgs,
    searcher: &Searcher,
) -> Result<Box<dyn Query>, QueryFactoryError> {
    let default_fields: Vec<Field> = if args.default_search_fields.is_empty() {
        return Err(QueryFactoryErrorK
    
    fn test_create_query_string_query() {
        let index = create_test_index().unwrap();
        let reader = index.reader().unwrap();
        let searcher = reader.searcher();

        let opts_json_str = r#"
            {
                "query": "\"a b\"",
                "default_search_fields": ["text"]
            }
        "#;
        let opts_json_bytes = opts_json_str.as_bytes();
        let opts = serde_json::from_slice::<QueryStringQueryArgs>(opts_json_bytes).unwrap();
        let query = create_query_string_query(&opts, &searcher).unwrap();

        let (top_docs, count) = searcher
            .search(&query, &(TopDocs::with_limit(10), Count))
            .unwrap();

        let mut docs = Vec::new();
        for (_score, doc_address) in top_docs {
            let doc = searcher.doc(doc_address).unwrap();
            docs.push(doc);
        }

        assert_eq!(docs.len(), 1);

        assert_eq!(count, 1);
    }