RE: Liferay 7.1 customize search results

thumbnail
Chuck Brewton, modified 6 Years ago. New Member Posts: 6 Join Date: 10/28/12 Recent Posts
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
thumbnail
Arun Das, modified 6 Years ago. Regular Member Posts: 166 Join Date: 7/23/12 Recent Posts
Hi Chuck,
Have you figured it out?
thumbnail
Chuck Brewton, modified 6 Years ago. New Member Posts: 6 Join Date: 10/28/12 Recent Posts
No.  Was working on solution to override osgi component for QueryHelperImpl but do not have that fully working.