Thanks, Erick. That really helped us in learning about tokens and how the 
Analyzer works. Thank you!

Warm regards,
Alex 


-----Original Message-----
From: Erick Erickson [mailto:erickerick...@gmail.com] 
Sent: 19 September 2012 3:56 PM
To: solr-user@lucene.apache.org
Subject: Re: Wildcard searches don't work

Take a look at admin/analysis on the text_general type You'll see that 
StandardTokenizer is breaking the input strings up into individual tokens on 
the colons and hyphens, so 2010-01-27T00:00:00Z becomes the tokens
2010 01 27T00 00 00Z

admin/analysis should be your first reflex when you encounter things like this 
<G>...

Best
Erick


On Wed, Sep 19, 2012 at 7:00 AM, Ahmet Arslan <iori...@yahoo.com> wrote:
>> We're having difficulty with some wildcard searches in Solr 4.0Beta. 
>> We're using a copyField to write a "tdate" to a "text_general" field. 
>> We are using the default definition for the "text_general" field 
>> type.
>>
>>     <field name="my_date" type="tdate"
>> indexed="true" stored="true" />
>>     <field name="date_text"
>> type="text_general" indexed="true" stored="true" />
>>
>>     <copyField source="my_date"
>> dest="date_text"/>
>>
>> Here's the sample data it holds:
>>
>>     2010-01-27T00:00:00Z
>>     2010-01-28T00:00:00Z
>>     2010-01-31T00:00:00Z
>>
>> We run these queries and they return the expected results:
>>
>>     date_text:"2010*"
>>     date_text:"2010-*"
>>     date_text:"2010-01*"
>>     date_text:"2010-01-*"
>>
>> However, when we run these, they return nothing. What are we doing 
>> wrong?
>>
>>     date_text:"*-01-27"
>>     date_text:"2010-*-27"
>>     date_text:"2010-01-27*"
>
> I think in your case you need to use string type instead of text_general.
>
> <field name="date_text" type="string" indexed="true" stored="true" />

Reply via email to