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: Liferay 7.1 customize search results
LIferay 7.1 GA4 / Tomcat bundle.
I am attempting to prevent search queries from matching the userName field for documents. Right now if i search for "john w smith" it will match the userName value for documents and other asset types (this is when the user with fullName "john w smith" uploaded the document or added the content). My first attempt was to override the Elasticsearch type mapping using the following value to prevent the storing of the userName field; however that did not work. it still allowed the exact phrase match to happen. It did prevent single keyword matching to the userName field. Even with the mapping below the elasticsearch returned json has _source data and that still has userName values in it.{
"LiferayDocumentType" : {
"properties": {
"userName" : {
"type" : "keyword",
"store" : false
}
}
}
}
Next i have tried to override some osgi component classes in the portal-search and portal-search-web modules, but have not had success. Any other suggestions for preventing searches from matching the userName field in the index?
Thanks,Chuck
I am attempting to prevent search queries from matching the userName field for documents. Right now if i search for "john w smith" it will match the userName value for documents and other asset types (this is when the user with fullName "john w smith" uploaded the document or added the content). My first attempt was to override the Elasticsearch type mapping using the following value to prevent the storing of the userName field; however that did not work. it still allowed the exact phrase match to happen. It did prevent single keyword matching to the userName field. Even with the mapping below the elasticsearch returned json has _source data and that still has userName values in it.{
"LiferayDocumentType" : {
"properties": {
"userName" : {
"type" : "keyword",
"store" : false
}
}
}
}
Next i have tried to override some osgi component classes in the portal-search and portal-search-web modules, but have not had success. Any other suggestions for preventing searches from matching the userName field in the index?
Thanks,Chuck
Hi Chuck,
Have you figured it out?
Have you figured it out?
No. Was working on solution to override osgi component for QueryHelperImpl but do not have that fully working.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™