lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A. Steven Anderson" <a.steven.ander...@gmail.com>
Subject Re: leading and trailing wildcard query
Date Thu, 05 Nov 2009 23:07:33 GMT
Thanks for the solution, but could you elaborate on how it would find
something like *abc* in a field that contains xxxxabcxxxx.

Steve

On Thu, Nov 5, 2009 at 5:25 PM, Bernadette Houghton <
bernadette.houghton@deakin.edu.au> wrote:

> I've just set up something similar (much thanks to Avesh!)-
>
> <fieldType name="edgytext" class="solr.TextField"
> positionIncrementGap="100">
>  <analyzer type="index">
>   <tokenizer class="solr.KeywordTokenizerFactory"/>
>   <filter class="solr.LowerCaseFilterFactory"/>
>   <filter class="solr.EdgeNGramFilterFactory" minGramSize="5"
> maxGramSize="25" />
>  </analyzer>
>  <analyzer type="query">
>   <tokenizer class="solr.KeywordTokenizerFactory"/>
>   <filter class="solr.LowerCaseFilterFactory"/>
>  </analyzer>
> </fieldType>
>
> <fieldType name="doubleedgytext" class="solr.TextField"
> positionIncrementGap="100">
>  <analyzer type="index">
>   <tokenizer class="solr.KeywordTokenizerFactory"/>
>   <filter class="solr.LowerCaseFilterFactory"/>
>   <filter class="solr.NGramFilterFactory" minGramSize="5" maxGramSize="25"
> />
>  </analyzer>
>  <analyzer type="query">
>   <tokenizer class="solr.KeywordTokenizerFactory"/>
>   <filter class="solr.LowerCaseFilterFactory"/>
>  </analyzer>
> </fieldType>
> .
> .
>   <field name="beginswith" type="edgytext" indexed="true" stored="false"
> multiValued="true"/>
>   <field name="contains" type="doubleedgytext" indexed="true"
> stored="false" multiValued="true"/>
> .
> .
>   <!-- Copy for BEGINSWITH search -->
>   <copyField source="content" dest="beginswith"/>
>   <copyField source="*_t" dest="beginswith"/>
>   <copyField source="*_mt" dest="beginswith"/>
>
>   <!-- Copy for CONTAINS search -->
>   <copyField source="content" dest="contains"/>
>   <copyField source="*_t" dest="contains"/>
>   <copyField source="*_mt" dest="contains"/>
>
> bern

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