Search with the characters (!,@,#,$,%,^,&,*,(,),{,},[,])...

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Search with the characters (!,@,#,$,%,^,&,*,(,),{,},[,])...

nithyavembu
This post was updated on .
Hi All,

 Now i am facing problem in special character search.
 I tried with the following special characters (!,@,#,$,%,^,&,*,(,),{,},[,]).
 My indexing data is :
    !national!
        @national@
        #national#
        $national$
        %national%
        ^national^
        &national&
       
 My search data is :
     @national@

 But when i search for "@national@", it returns the following result:

        !national!
        @national@
        #national#
        $national$
        %national%
        ^national^
        &national&
       
 But the actual result should be "@national@".
 So it match only "national" and returning the result. It didnt match "@".
 In solr UI i tried by giving only "@" and there is no search result.But the index data contains words with  
special character.

 As said in lucene, i have used escaping character also during querying.
 Whether i have to change any congifuration in schema.xml?
 I am using the same solrconfig.xml and schema.xml given by solr during download.
 If anyone know the solution and idea, please help me.  
 
with Regards,
nithya.
Reply | Threaded
Open this post in threaded view
|

Re: Search result not coming for normal special characters...

Erick Erickson
What analyzers are you using? Many analyzers (both index and
query time) will remove non-alpha characters.

Best
Erick

On Feb 7, 2008 1:14 PM, nithyavembu <[hidden email]> wrote:

>
> Hi All,
>
>  Now i am facing problem in special character search.
>  I tried with the following special characters
> (!,@,#,$,%,^,&,*,(,),{,},[,]).
>  My indexing data is :
>    !national!
>        @national@
>        #national#
>        $national$
>        %national%
>        ^national^
>        &national&
>
>  My search data is :
>     @national@
>
>  But when i search for "@national@", it returns the following result:
>
>        !national!
>        @national@
>        #national#
>        $national$
>        %national%
>        ^national^
>        &national&
>
>  But the actual result should be "@national@".
>  So it match only "national" and returning the result. It didnt match "@".
>  In solr UI i tried by giving only "@" and there is no search result.Butthe
> index data contains words with
> special character.
>  Whether i have to change any congifuration in schema.xml?
>  I am using the same solrconfig.xml and schema.xml given by solr during
> download.
>  If anyone know the solution and idea, please help me.
>
> with Regards,
> nithya.
> --
> View this message in context:
> http://www.nabble.com/Search-result-not-coming-for-normal-special-characters...-tp15339827p15339827.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Search result not coming for normal special characters...

nithyavembu
Thanks Erick.
     Here i have attached the schema.xml. As you said, i have noticed and many analyzers are there.
Can you please tell me which analyzer i have to avoid for this special character usage?schema.xml





Thanks,
nithya.



<quote author="Erick Erickson">
What analyzers are you using? Many analyzers (both index and
query time) will remove non-alpha characters.

Best
Erick

Reply | Threaded
Open this post in threaded view
|

Re: Search result not coming for normal special characters...

Erick Erickson
When in doubt, use WhitespaceAnalyzer and build up from there. It's the
simplest. Look at the Lucene docs for what the various analyzers do
under the covers.

Note: WhitespaceAnalyzer does NOT transform to lowercase, you have
to do that yourself or compose your own analyzer.....

Erick

On Feb 9, 2008 3:03 AM, nithyavembu <[hidden email]> wrote:

>
> Thanks Erick.
>     Here i have attached the schema.xml. As you said, i have noticed and
> many analyzers are there.
> Can you please tell me which analyzer i have to avoid for this special
> character usage? http://www.nabble.com/file/p15369487/schema.xml
> schema.xml
>
>
>
>
>
> Thanks,
> nithya.
>
>
>
>
> What analyzers are you using? Many analyzers (both index and
> query time) will remove non-alpha characters.
>
> Best
> Erick
>
>
> --
> View this message in context:
> http://www.nabble.com/Search-with-the-characters-%28%21%2C%40%2C-%2C%24%2C-%2C%5E%2C-%2C*%2C%28%2C%29%2C%7B%2C%7D%2C-%2C-%29...-tp15339827p15369487.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Search result not coming for normal special characters...

nithyavembu
Thanks Erick.

I have tried with WhitespaceAnalyzer as you said.

-> In my schema.xml i have removed the filter class "solr.WordDelimiterFilterFactory" for both indexing and querying.

-> If i remove this, the special character search works fine. But i am unable to search for this scenario...

 example : indexData : sriHari, sweetHeart,mike Oliver

 SearchData:

             If i search for sri, sweet,mike or oliver it returns the search result correctly. But if i search for
"Hari","Heart" its not returning the result. In the middle of the term if i give any word i am unable to search.
-> I found that in "solr.WordDelimiterFilterFactory" will split the word and provides the middle of word search. But special character ignored here.
       
-> I need the both the scenarios to work. Is it possible? Any idea or solution?
 
Thanks,
Nithya.



<quote author="Erick Erickson">
When in doubt, use WhitespaceAnalyzer and build up from there. It's the
simplest. Look at the Lucene docs for what the various analyzers do
under the covers.

Note: WhitespaceAnalyzer does NOT transform to lowercase, you have
to do that yourself or compose your own analyzer.....

Erick