You could have PatternReplace in your field definition either as a
CharFilter or a TokenFilter. See:
http://www.solr-start.com/info/analyzers/

Regards,
   Alex.

On 16 August 2018 at 11:20, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> Shawn,
>
> On 8/16/18 10:37 AM, Shawn Heisey wrote:
>> On 8/16/2018 7:48 AM, Christopher Schultz wrote:
>>> I haven't actually tried this, yes, but from the docs I'm guessing that
>>> I can't search for a DOB using e.g. 2018-08-16 but instead I need to
>>> search using 2018-08-16T00:00:00 plus maybe "Z" at the end for the TZ.
>>>
>>> No user is ever going to do that.
>>
>> If you use the field class called DateRangeField, instead of the trie or
>> point classes, you can get what you're after.
>>
>> It allows both searching and indexing dates as vague as "2018".
>>
>> https://lucene.apache.org/solr/guide/7_4/working-with-dates.html
>
> Hmm. I could have sworn the documentation I read in the past (maybe as
> long as 3-4 months ago) indicated that date+timestamp was necessary.
> Maybe that was just for the index, while the searches can be partial.
>
> As long as users don't have to enter timestamps to search, I think all
> is well in terms of index/search for me.
>
> As for i18n, is there a way to have the query analyzer convert strings
> like "mm/dd/yyyy" into "yyyy-mm-dd"?
>
> I'm sure we can take the query (before handing-off to Solr), look for
> anything that looks like a date and convert it into ISO-8601 for
> searching, but if Solr already provides a facility to do that, I'd
> rather not complicate my code in order to get it working.
>
>> For an existing index, you will have to change the schema and completely
>> reindex.
>
> That's okay. The index doesn't actually exist, yet :) This is all just
> planning.
>
> Thanks,
> -chris
>

Reply via email to