You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by anuja jain <an...@gmail.com> on 2016/01/19 13:06:34 UTC

solr Textsearch in dse 4.8.3

Hi,
I am using solr of dse 4.8.3 to do text search on cassandra data.
On a String type column when I am use regex email:*gmail* it does not
return me the data that is inserted after starting cassandra in solr mode.
Infact on hitting query everytime it is returning different result.
Schema.xml has following entries for email column
 <fieldType name="string" class="solr.StrField"/>
<analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
<field name="email" type="string" indexed="true"  stored="true"/>

What settings do I need to do for it?

Thanks,
Anuja

Re: solr Textsearch in dse 4.8.3

Posted by Jack Krupansky <ja...@gmail.com>.
Solr string fields (solr.StrField) are not tokenized, so they do not have
analyzers. That means they will be case-sensitive.

Regex is introduced with slash characters, so you appear to be performing a
wildcard query instead.

Typically, you would make a copy of such a Cassandra text field (using
<CopyField>) so that it is indexed twice, once as a solr StrField suitable
for exact matching (the full string) and once as a Solr tokenized TextField
so that you can search for words in the string without having to resort to
expensive wildcards.

-- Jack Krupansky

On Tue, Jan 19, 2016 at 7:06 AM, anuja jain <an...@gmail.com> wrote:

> Hi,
> I am using solr of dse 4.8.3 to do text search on cassandra data.
> On a String type column when I am use regex email:*gmail* it does not
> return me the data that is inserted after starting cassandra in solr mode.
> Infact on hitting query everytime it is returning different result.
> Schema.xml has following entries for email column
>  <fieldType name="string" class="solr.StrField"/>
> <analyzer>
>         <tokenizer class="solr.StandardTokenizerFactory"/>
>         <filter class="solr.LowerCaseFilterFactory"/>
>       </analyzer>
> <field name="email" type="string" indexed="true"  stored="true"/>
>
> What settings do I need to do for it?
>
> Thanks,
> Anuja
>