Fork me on GitHub
#xtdb
<
2024-02-08
>
Onur Yazgan11:02:19

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.

refset15:02:04

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&amp;cid=CG3AM2F7V tl:dr; is yes can can configure it fairly simply, but beware of the tradeoffs

Onur Yazgan15:02:57

awesome, thanks 🙏

👌 1