On 1/31/14 3:59 PM, Nick D. wrote:

Store this: "This is an Example of what a case Sensitive line would be"

Search for this: "Example"
Also search for this: "example"

And return the line stored for both searches.

I have a need to have the option to do case insensitive and case sensitive
searches at search time and having 2 indexes (1 for each case) is not really
an option due to the amount of live data (data constantly coming off the
wire) being indexed at once.


Store the same text under two different fields in the same index, one with an Analyzer w/CaseFolder (foo_lc) and one w/o (foo_cs).

Then your query parser can expand your query to an 'OR' search for both fields. The alias_for feature in Search::Query::Parser could help:

 my $parser = Search::Query::Parser->new(
    dialect => 'Lucy',
    fields  => {
        foo => [qw( foo_lc foo_cs )],
    },
 );

https://metacpan.org/pod/Search::Query::Field#alias_for


--
Peter Karman  .  http://peknet.com/  .  [email protected]

Reply via email to