There is special handling build into Solr (but not Lucene I don't think)
that deals with the reversed case, that's probably the source of your
differences.

Leading wildcards are extremely painful if you don't do some trick
like Solr does with the reversed stuff. In order to run, you have to
spin through _every_ term in the field to see which ones match. It
won't be performant on any very large index.

So I would stick with using the Solr stuff unless you have a specific
need to do things at the Lucene level. In which case I'd look carefully
at the Solr implementation to see what I could glean from that
implementation.

Best
Erick

On Thu, Apr 12, 2012 at 8:01 AM, neosky <neosk...@yahoo.com> wrote:
> I ask the question in
> http://lucene.472066.n3.nabble.com/A-little-onfusion-with-maxPosAsterisk-tt3889226.html
> However, when I do some implementation, I get a further questions.
> 1. Suppose I don't use ReversedWildcardFilterFactory in the index time, it
> seems that Solr doesn't allow the leading wildcard search, it will return
> the error:
> org.apache.lucene.queryParser.ParseException: Cannot parse
> 'sequence:*AAAAA*': '*' or '?' not allowed as first character in
> WildcardQuery
> But when I use the ReversedWildcardFilterFactory, I can use the *AAAAA* in
> the query. But as I know, the ReversedWildcardFilterFactory should work in
> the index part, should not affect the query behavior. If it is true, how
> does this happen?
> 2.Based on the question above
> suppose I have those tokens in index.
> 1.AB/MNO/UUFI
> 2.BC/MNO/IUYT
> 3.D/MNO/QEWA
> 4./MNO/KGJGLI
> 5.QOEOEF/MNO/
> suppose I use the lucene, I can set the QueryParser with
> AllowLeadingWildcard(true), to search *MNO*
> it should return the tokens above(1-5)
> But in solr, when I conduct the *MNO* with the ReversedWildcardFilterFactory
> in the index, but use the StandardAnalyzer in the query, I don't know what
> happens here.
> The leading *MNO should be fast to match the 5 with
> ReversedWildcardFilterFactory
> The tailer MNO* should be fast to match 4
> But What about *MNO* ?
> Thanks!
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Further-questions-about-behavior-in-ReversedWildcardFilterFactory-tp3905416p3905416.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to