lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sophie M." <>
Subject Alphabetic range
Date Wed, 23 Jun 2010 12:56:39 GMT

Hello all,

I try since several day to build up an alphabetical range. I will explain
all steps (i have the Solr1.4 Enterprise  Search Server book written by
Smiley and Pugh).

I want get all artists beginning by the two first letter. If I request "mi",
I want to have as response "michael jackson" and all artists name beginning
by "mi".

I defined a field type similiar to Smiley and Pugh's example p.148

<fieldType name="bucketFirstTwoLetters" class="solr.TextField"
sortMissingLast="true" omitNorms="true">
		<analyser type="index">
			<tokenizer class="solr.PatternTokenizerFactory"
pattern="^([a-zA-Z])([a-zA-Z]).*" group="2"/> <!-- les deux premieres
		<analyser type="query">
			<tokenizer class="solr.KeywordTokenizerFactory"/>
I defined the field ArtistSort like : 

<field name="ArtistSort" type="bucketFirstTwoLetters" stored="true"
To the request : 


I get : select.xml 

I don't understand why the pattern doesn't my exacty. For example "An An Yu"
matches but I only want artists whom name begins by "yu". And I know that an
artist named ReYu would match because ReYu would be interpreted as Re Yu (as
two words).

I also tried to make an other type of queries like : 


I get exacly what I would. I made several tries, I get only artist's names
wich begins by the good first to letters.

But I get very few responses, see there :

result name="response" numFound="6" start="0">

<str name="ArtistSort">mike manne and tiger blues</str>
<str name="ArtistSort">mimika</str>
<str name="ArtistSort">miduno</str>
<str name="ArtistSort">milue macïro</str>
<str name="ArtistSort">mister pringle</str>
<str name="ArtistSort">mimmai</str>

In my index there is more than 80 000 artists...  I really don't understand
why I can't get more responses. I think about the problem since days and
days and now my brain freezes 

Thank you in advance.

View this message in context:
Sent from the Solr - User mailing list archive at

View raw message