Skip to content

More clojure way to create queries? #22

@JanDornbusch

Description

@JanDornbusch

As you know I am playing with flux currently without much knowledge of solr. Inspired by some sql libraries what do you think about a more clojure way building queries?

What I've done so far:

(q (or {:en 1} 
       (and {"de" 2}
            (+ :foo)
            (- "test")) 
       {:fr (not 4 "bar")}))
;; => "q=(en:1 || (de:2 &&  +foo &&  -test) || fr ! 4 && fr ! bar)"

;; Do you prefer (implemented both, nothing more to decide here)
(q {"foo" [:* 4]})
;; or
(q {"foo" (range :* 4)})
;; => "q=foo:[* TO 4]"

I'm not sure if those prohibits and requires are correct this way.

As said I start using solr now and not build many queries before. It would help me to add cases to this query builder when you show me some sample query strings.

Not sure if it's all if I go through examples of solr as alternative

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions