PerFieldAnalyzerWrapper is the way to mix and match fields and analyzers.

Personally I'd simply store the case-insensitive field with a call to
toLowerCase() on the value and equivalent on the search string.

You will of course use more storage, but you don't need to store the
text contents for both variants so it won't be double.  Unless you
aren't storing the original either.


--
Ian.


On Fri, Sep 19, 2014 at 2:50 PM, John Cecere <john.cec...@oracle.com> wrote:
> I've considered this, but there are two problems with it. First of all, it
> feels like I'm still taking up twice the storage, I'm just doing it using a
> single index rather than two of them. This doesn't sound like it's buying me
> anything.
>
> The second problem with this is simply that I haven't figured out how to do
> this. I assume in creating two fields you would implement two separate
> analyzers on them, one using LowerCaseFilter and the other not. I haven't
> made the connection on how to tie an Analyzer to a particular field. It
> seems to be tied to the IndexWriterConfig and the IndexWriter.
>
> Thanks,
> John
>
>
> On 9/19/14 9:36 AM, Paul Libbrecht wrote:
>>
>> two fields?
>>
>> paul
>>
>>
>> On 19 sept. 2014, at 15:07, John Cecere <john.cec...@oracle.com> wrote:
>>
>>> Is there a way to set up Lucene so that both case-sensitive and
>>> case-insensitive searches can be done without having to generate two
>>> indexes?
>>>
>>> --
>>> John Cecere
>>> Principal Engineer - Oracle Corporation
>>> 732-987-4317 / john.cec...@oracle.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
>>> For additional commands, e-mail: java-user-h...@lucene.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
>> For additional commands, e-mail: java-user-h...@lucene.apache.org
>>
>
> --
> John Cecere
> Principal Engineer - Oracle Corporation
> 732-987-4317 / john.cec...@oracle.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to