lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Kan <>
Subject Re: Wild card on field search
Date Thu, 03 Oct 2013 10:24:00 GMT
actually, it isn't possible to define a tokenizer on a string field,
therefore you should use custom TextField.

To enable the wildcards:

1. trailing wildcard prepa* should work off the shelf
2. leading wildcard *test can be enabled with the following filter (with
our own settings, entire filter has been dropped due to caution below):

<!-- add this after you tokenizers -->
<filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>

caution: this may potentially double your index in absolute count of
tokens, but with solr4's compression it can be acceptable.

The reason to reverse the tokens for a leading wildcard search is that
without this solr would need to scan the entire dictionary of terms in
order to find suffix matches. And with reversing you need to scan only the
suffix's subset of reversed tokens.


On Thu, Oct 3, 2013 at 11:06 AM, soumikghosh05 <>wrote:

> I want to store the below string into Title field.
> this is a test title prepared for solar wild card query.
> I want to query the it with the below string.
>  *test title prepa*
> What type of field type I should use? (string or TextField) and what type
> of
> tokenizer I should use?
> what would be my query syntax?
> I am very new to Solr. Any help or suggestion would be great help for me.
> Thanks in Advance,
> Soumik
> --
> View this message in context:
> Sent from the Solr - User mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message