FAQ
Hello,

I have below custom field type defined for solr 6.0.0

    <fieldType name="my_string" class="solr.TextField" positionIncrementGap="100" multiValued="true">
     <analyzer type="index">
       <tokenizer class="solr.KeywordTokenizerFactory"/>
       <filter class="solr.LowerCaseFilterFactory"/>
     </analyzer>
     <analyzer type="query">
       <tokenizer class="solr.KeywordTokenizerFactory"/>
       <filter class="solr.LowerCaseFilterFactory"/>
     </analyzer>
   </fieldType>


I am using above field to ensure that entire string is considered as single token and search should be case insensitive.

It works for most of the scnearios with wildcard search.
e.g. if my data is "abc.pqr" and "abc_pqr" and "abc pqr" then search with abc* gives this three results.

But I am not able to search with say abc p*

Search with query q="abc pqr" gives exact match and desired result.

I want to do wildcard search where criteria can include spaces like above example


i.e. if space is present then I am not able to to wildcard search.

Is there any way by which wildcard search will be achieved even if space is present in token.

Regards,
Roshan
________________________________
The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.

Search Discussions

  • Ahmet Arslan at Jun 15, 2016 at 12:55 pm
    Hi Roshan,

    I think there are two options:

    1) escape the space q=abc\ p*
    2) use prefix query parser q={!prefix f=my_string}abc p

    Ahmet


    On Wednesday, June 15, 2016 3:48 PM, Roshan Kamble wrote:
    Hello,

    I have below custom field type defined for solr 6.0.0

        <fieldType name="my_string" class="solr.TextField" positionIncrementGap="100" multiValued="true">
         <analyzer type="index">
           <tokenizer class="solr.KeywordTokenizerFactory"/>
           <filter class="solr.LowerCaseFilterFactory"/>
         </analyzer>
         <analyzer type="query">
           <tokenizer class="solr.KeywordTokenizerFactory"/>
           <filter class="solr.LowerCaseFilterFactory"/>
         </analyzer>
       </fieldType>


    I am using above field to ensure that entire string is considered as single token and search should be case insensitive.

    It works for most of the scnearios with wildcard search.
    e.g. if my data is "abc.pqr" and "abc_pqr" and "abc pqr" then search with abc* gives this three results.

    But I am not able to search with say abc p*

    Search with query q="abc pqr" gives exact match and desired result.

    I want to do wildcard search where criteria can include spaces like above example


    i.e. if space is present then I am not able to to wildcard search.

    Is there any way by which wildcard search will be achieved even if space is present in token.

    Regards,
    Roshan
    ________________________________
    The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
  • Roshan Kamble at Jun 15, 2016 at 1:08 pm
    Great.
    First option worked for me. I was trying with q=abc\sp*... it should be q=abc\ p*

    Thanks

    -----Original Message-----
    From: Ahmet Arslan
    Sent: Wednesday, June 15, 2016 6:25 PM
    To: solr-user@lucene.apache.org; Roshan Kamble
    Subject: Re: wildcard search for string having spaces

    Hi Roshan,

    I think there are two options:

    1) escape the space q=abc\ p*
    2) use prefix query parser q={!prefix f=my_string}abc p

    Ahmet


    On Wednesday, June 15, 2016 3:48 PM, Roshan Kamble wrote:
    Hello,

    I have below custom field type defined for solr 6.0.0

        <fieldType name="my_string" class="solr.TextField" positionIncrementGap="100" multiValued="true">
         <analyzer type="index">
           <tokenizer class="solr.KeywordTokenizerFactory"/>
           <filter class="solr.LowerCaseFilterFactory"/>
         </analyzer>
         <analyzer type="query">
           <tokenizer class="solr.KeywordTokenizerFactory"/>
           <filter class="solr.LowerCaseFilterFactory"/>
         </analyzer>
       </fieldType>


    I am using above field to ensure that entire string is considered as single token and search should be case insensitive.

    It works for most of the scnearios with wildcard search.
    e.g. if my data is "abc.pqr" and "abc_pqr" and "abc pqr" then search with abc* gives this three results.

    But I am not able to search with say abc p*

    Search with query q="abc pqr" gives exact match and desired result.

    I want to do wildcard search where criteria can include spaces like above example


    i.e. if space is present then I am not able to to wildcard search.

    Is there any way by which wildcard search will be achieved even if space is present in token.

    Regards,
    Roshan
    ________________________________
    The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
    ________________________________
      The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsolr-user @
categorieslucene
postedJun 15, '16 at 12:48p
activeJun 15, '16 at 1:08p
posts3
users2
websitelucene.apache.org...

2 users in discussion

Roshan Kamble: 2 posts Ahmet Arslan: 1 post

People

Translate

site design / logo © 2019 Grokbase