Hi, 
I just found the root cause. The definition for the 'long' type is not right. 
the previous definition was:

<fieldType name="long" class="solr.LongField" omitNorms="true"/>

which doesn't support range query! now I changed to : <fieldType name="long" 
class="solr.TrieLongField" precisionStep="8" omitNorms="true" 
positionIncrementGap="0"/>, and it's done!

Thanks a lot!
Liang

-----Original Message-----
From: Erick Erickson [mailto:erickerick...@gmail.com] 
Sent: 2012年4月10日 6:53
To: solr-user@lucene.apache.org
Subject: Re: Problem about range search

Hmmm, works fine for me using the "popularity" field in the default schema.

What version of Solr are you using? What is your complete handler definition?

Best
Erick

On Mon, Apr 9, 2012 at 12:10 AM, ZHANG Liang F 
<liang.f.zh...@alcatel-sbell.com.cn> wrote:
> Hi,
> I ran into a problem when trying range facet search. I had a schema define 
> like this:
>  <fields>
>   <field name="title" type="string" indexed="true" stored="true"/>
>   <field name="author" type="string" indexed="true" stored="true" />
>   <field name="text" type="text" indexed="true" stored="true" />
>   <field name="path" type="string" indexed="true" stored="true" />
>   <field name="size" type="long" indexed="true" stored="true" />
>   <field name="lastmodified" type="date" indexed="true" stored="true" 
> />
>  </fields>
>
> I try to set up a range search on "size" field which stands for the size of a 
> file. So I have the following requestHandler config in solrconfig.xml:
>  <str name="facet.range.other">after</str>
>  <str name="facet.range">size</str>
>  <int name="f.size.facet.range.start">0</int>
>  <int name="f.size.facet.range.end">15728640</int><!-- around 15M -->
>  <int name="f.size.facet.range.gap">3145728</int><!-- around 3M -->
>
> But an error says:  Unable to range facet on 
> field:size{type=long,properties=indexed,stored,omitNorms,omitTermFreqA
> ndPositions}
>
> It doesn't show any clue, and I also tried <long> tag, but got the same error.
>
> Could you please help to suggest?
>
> Thanks in advance!

Reply via email to