Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Making lucene search case Insensitive
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
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
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.
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.
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.
http://issues.liferay.com/browse/LPS-16895
Try specifying StandardAnalyzer there.
Hi Hitoshi,
Thank you for the response . Kindly tell me where can i create the xml and put the new analyzer.
regards
Sri
Thank you for the response . Kindly tell me where can i create the xml and put the new analyzer.
regards
Sri
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
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
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