lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernadette Houghton <>
Subject RE: "begins with" searches
Date Tue, 27 Oct 2009 03:52:31 GMT
Thanks for this suggestion (thanks Gerald also: no, we're not using BlackLight-type prefixes).

I've set up an edgytext fieldType in schema.xml thus -

<fieldType name="edgytext" class="solr.TextField" positionIncrementGap="100">
 <analyzer type="index">
   <tokenizer class="solr.KeywordTokenizerFactory"/>
   <filter class="solr.LowerCaseFilterFactory"/>
   <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="25" />
 <analyzer type="query">
   <tokenizer class="solr.KeywordTokenizerFactory"/>
   <filter class="solr.LowerCaseFilterFactory"/>

And defined a field name thus -

<dynamicField name="*author_mt"  type="edgytext"    indexed="true"  stored="true" multiValued="true"/>

The results are mixed -

* searches such as "surname, f" and "surname, fre" (with quotations and commas) work well,
retrieving "surname, f", "surname, Fred", "surname, Frederick" etc etc
* searches such as the above but without quotations don't work too well as they get parsed
as author_mt:surname + author_mt:firstname, with solr reading the query as "author beginning
with surname AND author beginning with firstname", which yields nil results. 

Is there an analyser that will strip the whitespace out altogether? Or another alternative?


-----Original Message-----
From: Avlesh Singh [] 
Sent: Monday, 26 October 2009 6:32 PM
Subject: Re: "begins with" searches

Read up of setting-up these kind searches here -


On Mon, Oct 26, 2009 at 7:43 AM, Bernadette Houghton <> wrote:

> We need to offer "begins with" type searches, e.g. a search for "surname,
> f" will retrieve "surname, firstname", "surname, f", "surname fm" etc.
> Ideally, the user would be able to enter something like "surname f*".
> However, wildcards don't work on phrase searches, nor do range searches.
> Any suggestions as to how best to search for "begins with" phrases; or, how
> to best configure solr to support such searches?
> Bernadette Houghton, Library Business Applications Developer
> Deakin University Geelong Victoria 3217 Australia.
> Phone: 03 5227 8230 International: +61 3 5227 8230
> Fax: 03 5227 8000 International: +61 3 5227 8000
> MSN:
> Email:<mailto:
> Website:
> <>Deakin University CRICOS Provider Code 00113B
> (Vic)
> Important Notice: The contents of this email are intended solely for the
> named addressee and are confidential; any unauthorised use, reproduction or
> storage of the contents is expressly prohibited. If you have received this
> email in error, please delete it and any attachments immediately and advise
> the sender by return email or telephone.
> Deakin University does not warrant that this email and any attachments are
> error or virus free

View raw message