If the search query contains a leading wildcard character (* or ?), the QueryParser's Parse function throws an error.
Dim q As String = "*abc"
Dim qp As New QueryParser("text", New StandardAnalyzer())
Dim query As Query = qp.Parse(q)
Is there any way to solve this problem in Lucene.NET v2.0.0.4?
From stackoverflow
-
Maybe you have to use a WildcardQuery, but
...In order to prevent extremely slow WildcardQueries, a Wildcard term should not start with one of the wildcards...
-
Set QueryParser.SetAllowLeadingWildcard Method to true. The API page states that "this can produce very slow queries on big indexes" though.
0 comments:
Post a Comment