peerkar / liferay-gsearch

Google like search for Liferay 7 CE and DXP
Other
56 stars 36 forks source link

support for MBMessage and User #15

Closed HarrariScript closed 5 years ago

HarrariScript commented 5 years ago

Hi,

i installed liferay-gsearch , it works fine except for forums and Users, when s type a user name or a keyword from a message board, it shows nothing on the results,

can you help !!

peerkar commented 5 years ago

Hi,

MBMessage: For 7.1, there's an old default configuration. If you take a look at the "Preconfigured filter", please replace the: "com.liferay.message.boards.kernel.model.MBMessage", with: "com.liferay.message.boards.model.MBMessage"

And it should work. Localization for the asset type seems also be missing. I'll fix these in repo next week.

User: First you have to enable user indexing as it's disabled in 7.1 by default. The you need to add the model class name to the preconfigured filters, as above. The last thing to do is to add a clause to include user fields in the query. I'll try to add an example to default configuration also next week.

Thanks,,,

HarrariScript commented 5 years ago

thanks for your replay ,

now it works for the MBMessage , for User i added com.liferay.portal.kernel.model.User to Preconfigured Filters , i dont know how to add clauses , so i'm waiting for your update ,

thanks a lot ,

HarrariScript commented 5 years ago

hi, any update about this issue ? thanks

peerkar commented 5 years ago

Hi and sorry for a long waiting,

Support for User and MBMessage is now in the default pre-filter config for core-impl.

Support for User entity required changes to the staging filter, so the whole core-impl module has to be updated. Also, because of new localizations, please update the gsearch-web too.

Also you need to modify clause config a bit to search for user fields.

Instructions:

1) Update the gsearch-core-impl and gsearch-web. The new binaries are here 2) Update the core filter config, or reset your current one to get the new default config applied. The new config is here 3) In the default clauses configuration, in the very first clause, add the fullName (or whatever you need) to the fields section. This is just a basic example but should get user search to work:

        "fields": [
          {
            "field_name": "title",
            "localized": true,
            "boost": 3.0,
            "boost_localized_version": 5.0
          },
          {
            "field_name": "content",
            "localized": true,
            "boost": 1.0,
            "boost_localized_version": 2.0
          },
          {
            "field_name": "assetTagNames",
            "localized": false,
            "boost": 2.0
          },
          {
            "field_name": "fullName",
            "localized": false,
            "boost": 1.0
          }
        ],

4) In the Control Panel -> System Settings -> Search -> Default Keyword Query, remove the "com.liferay.portal.kernel.model.User" from "Disabled Entry Class Names" 5) Reindex