How to search Case Sensitive words?

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

How to search Case Sensitive words?

nithyavembu
Hi All,

    Now i am facing the problem with case sensitive text. I am indexing smaller case word but when i give the same word in upper case for search, its not getting search.
    Example : Indexing word : "corent"
                  Searching word : "CORENT".
   If i search "CORENT" it retrieves nothing. Whether i have to change any configuration? I am using the default configuration. And it has lower case filter also.
   If any help, appreciated.

Regards,
V.Nithya.
Reply | Threaded
Open this post in threaded view
|

Re: How to search Case Sensitive words?

Donna L Gresh
I am a pretty new user of Lucene, but I think the simple answer is "what
analyzer are you using when you index" and "use the same analyzer
when you search". I believe StandardAnalyzer for example does
lowercasing, so if you use the same one when you search all should
work as you wish.
Reply | Threaded
Open this post in threaded view
|

Re: How to search Case Sensitive words?

nithyavembu
Hi Dona,

   Thanks a lot for your reply. Yeah, its with the analyzer we use for indexing and searching for case sensitive words. You are correct

   But Even i use those types of indexing and searching i am unable to search the case sensitive words..
   I am facing the problem in forming query.
   My query structure is : (searchtext+*).
   For example I am indexing three records named
     * priya
     * priyadarshini
     * priyan

   If i search for (PRIYA*), it has to retrieve the all three records. But it is retrieving nothing.
   If i search (PRIYA), it retrieving all.
   If i search (PRIYA\*), in encoded form (PRIYA%5C*), it retrieving only priya.

   In my query structure "*" should come after the search text to get all details..Its like google search..I have the necessity to use "*". But if i use "*", It does not retrieve record. At the same time i want all records with the case sensitive words. Is there any solution?

   Thanks in advance.

Regards,
V.Nithya.



Donna L Gresh wrote
I am a pretty new user of Lucene, but I think the simple answer is "what
analyzer are you using when you index" and "use the same analyzer
when you search". I believe StandardAnalyzer for example does
lowercasing, so if you use the same one when you search all should
work as you wish.