CommonRules based rewriter
CommonRules based rewriter
(boost boost query)
Boost a matching term or query.
;; Boost recipes which take less than 30 minutes when queries
;; match quick and recipe or recipes.
(match (and "quick" (or "recipe" "recipes")
(boost 10 {:range {:minutes {:lte 30}}}))
Boost a matching term or query. ```clojure ;; Boost recipes which take less than 30 minutes when queries ;; match quick and recipe or recipes. (match (and "quick" (or "recipe" "recipes") (boost 10 {:range {:minutes {:lte 30}}})) ```
(delete string)
Delete text from a matched query. This is useful for removing unhelpful search terms from the query.
Delete text from a matched query. This is useful for removing unhelpful search terms from the query.
(filter query)
Add a filter to the query. Filters require a match on documents.
(match "by paul krugman"
(filter {:term {:author "Paul Krugman"}}))
Add a filter to the query. Filters require a match on documents. ```clojure (match "by paul krugman" (filter {:term {:author "Paul Krugman"}})) ```
(match head & tail)
Create a rewriter rule from matching text input or boolean input followed by any number of query transformations.
;; Inject bar as a synonym to foo in any query.
(match "foo"
(synonym "bar"))
Create a rewriter rule from matching text input or boolean input followed by any number of query transformations. ```clojure ;; Inject bar as a synonym to foo in any query. (match "foo" (synonym "bar")) ```
(parse-rules stream)
(parse-rules stream
{:keys [boolean-input ignore-case parser]
:or {boolean-input true
ignore-case true
parser (WhiteSpaceQuerqyParserFactory.)}})
(rules-rewriter & args)
Create a CommonRulesRewriter.
You may pass in a resource pointing to a Querqy CommonRulesRewriter file or use the Clojure-DSL.
Create a CommonRulesRewriter. You may pass in a resource pointing to a Querqy CommonRulesRewriter file or use the Clojure-DSL.
(synonym string)
(synonym boost string)
Create a synonym for the matched text.
(match "chickpeas"
(synonym "garbanzo beans"))
Create a synonym for the matched text. ```clojure (match "chickpeas" (synonym "garbanzo beans")) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close