RE: Making lucene search case Insensitive

thumbnail
srikanth a, modified 13 Years ago. Regular Member Posts: 144 Join Date: 2/21/11 Recent Posts
Hi All,
I am working with lucene index for the first time. I am facing few issues with it. I have few queries.

1. Is lucene search is case Sensitive.
2. How to make it Insensitive in liferay.

I am passing a value for searching in the query. But i am not able to get the proper results because the query which booleanQuery creates is in lowercase.
The values which lucene stores in capital letter. Because of this iam not able to get the results.

Kindly do post your ideas to resolve it.

regards
Sri
thumbnail
Sandip Patel, modified 13 Years ago. Regular Member Posts: 205 Join Date: 1/5/11 Recent Posts
HI Shrikanth,

As per my knowledge, please check with below code,

BooleanQuery searchQuery = BooleanQueryFactoryUtil.create();
searchQuery.addTerm("screenName", keywords, true);

In search query while you addTerm give one extraparameter boolean--> true. This may solve your prob.
thumbnail
Hitoshi Ozawa, modified 13 Years ago. Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
There used to be lucene.analyzer setting in portal-ext.properties where it was possible to specify lucene analyzer. It seems to have been moved in 6.1.
http://issues.liferay.com/browse/LPS-16895

Try specifying StandardAnalyzer there.
thumbnail
srikanth a, modified 13 Years ago. Regular Member Posts: 144 Join Date: 2/21/11 Recent Posts
Hi Hitoshi,
Thank you for the response . Kindly tell me where can i create the xml and put the new analyzer.

regards
Sri
thumbnail
Hitoshi Ozawa, modified 13 Years ago. Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
Kindly tell me where can i create the xml and put the new analyzer.


Did you read Brian Chan's comment in the LPS?

search-spring.xml is under the following directory in liferay source.
liferay-portal-src-6.1.0-ce-rc1\portal-impl\src\META-INF
thumbnail
srikanth a, modified 13 Years ago. Regular Member Posts: 144 Join Date: 2/21/11 Recent Posts
Hi Hitoshi,
I have found that file and assed my new entri like below.

<entry key="portletId" value-ref="org.apache.lucene.analysis.standard.StandardAnalyzer" />

and copied search-spring.xml in my application and deployied. but still it is not fetching the results. Am i doing any mistake.
Please suggest me the correct path...its very urgent


regards
Sri