quickwit-oss/tantivy

Range queries on JSON fields

Open

#1,709 opened on Dec 5, 2022

View on GitHub
 (12 comments) (0 reactions) (0 assignees)Rust (499 forks)batch import
help wanted

Repository metrics

Stars
 (8,354 stars)
PR merge metrics
 (Avg merge 12d 14h) (20 merged PRs in 30d)

Description

Is your feature request related to a problem? Please describe.

I cannot perform range queries on JSON fields. For example, the examples/json_field.rs has a search like so:

    {
        let query = query_parser.parse_query("cart.product_id:103")?;
        let count_docs = searcher.search(&*query, &Count)?;
        assert_eq!(count_docs, 1);
    }

But I cannot rewrite the query like this:

    {
        let query = query_parser.parse_query("cart.product_id < 110")?;
        let count_docs = searcher.search(&*query, &Count)?;
        assert_eq!(count_docs, 1);
    }

the count comes back 0.

Describe the solution you'd like

We should be able to search nested JSON documents with the usual <, >, etc.

Contributor guide