This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-08
Channels
- # aleph (7)
- # announcements (12)
- # babashka (19)
- # beginners (4)
- # calva (29)
- # cider (20)
- # clj-kondo (20)
- # clojure (66)
- # clojure-austin (4)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (42)
- # clojure-uk (4)
- # clojuredesign-podcast (9)
- # conjure (1)
- # cursive (5)
- # datomic (42)
- # etaoin (4)
- # events (10)
- # garden (8)
- # graphql (1)
- # holy-lambda (7)
- # honeysql (3)
- # hyperfiddle (5)
- # missionary (11)
- # music (1)
- # off-topic (12)
- # practicalli (2)
- # re-frame (2)
- # reitit (6)
- # releases (2)
- # vim (2)
- # web-security (1)
- # xtdb (3)
Hey! I am reading the https://v1-docs.xtdb.com/extensions/full-text-search/ and there's this sentence: "This module does not support "leading wildcard" searches, e.g. "*van", even though Lucene is technically capable of performing these queries."
When I tried it, I indeed faced this error:
(q {:find '[?e ?v ?a ?s]
:limit 10
:where '[[(wildcard-text-search "*test*") [[?e ?v ?a ?s]]]
[?e :xt/id]]})
;; => Execution error (ParseException) at org.apache.lucene.queryparser.classic.QueryParserBase/getWildcardQuery (QueryParserBase.java:698).
;; '*' or '?' not allowed as first character in WildcardQuery
Looking at https://lucene.apache.org/core/3_5_0/api/all/org/apache/lucene/queryParser/QueryParser.html, I came across this method:
*setAllowLeadingWildcard*(boolean allowLeadingWildcard)
I was wondering if there's a simple way to call setAllowLeadingWildcard to enable leading wildcard searches in my XTDB node.
Hey @U052SBNC4QN - apologies this hasn't made it into an FAQ in the docs already, but this old thread should help: https://clojurians.slack.com/archives/CG3AM2F7V/p1666811660708229?thread_ts=1666802584.202249&cid=CG3AM2F7V tl:dr; is yes can can configure it fairly simply, but beware of the tradeoffs