Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
srikanth a
Making lucene search case Insensitive
May 24, 2012 1:25 AM
Answer

srikanth a

Rank: Regular Member

Posts: 142

Join Date: February 20, 2011

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
Sandip Patel
RE: Making lucene search case Insensitive
May 24, 2012 5:41 AM
Answer

Sandip Patel

Rank: Regular Member

Posts: 171

Join Date: January 4, 2011

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.
Hitoshi Ozawa
RE: Making lucene search case Insensitive
May 24, 2012 6:29 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

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.
srikanth a
RE: Making lucene search case Insensitive
May 28, 2012 2:56 AM
Answer

srikanth a

Rank: Regular Member

Posts: 142

Join Date: February 20, 2011

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
Hitoshi Ozawa
RE: Making lucene search case Insensitive
May 28, 2012 2:46 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

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
srikanth a
RE: Making lucene search case Insensitive
September 23, 2012 6:22 AM
Answer

srikanth a

Rank: Regular Member

Posts: 142

Join Date: February 20, 2011

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