Fórumok

I want to use Search functionality of Document and Media in custom portlet

Jaspal Sharma, módosítva 8 év-val korábban

I want to use Search functionality of Document and Media in custom portlet

New Member Bejegyzések: 4 Csatlakozás dátuma: 2015.04.17. Legújabb bejegyzések
Hi,

I want to create a new portlet where i can search documents , I want to use search functionality of Documents and Media Portlet, I am new to Liferay, Please suggest me how can i start and how can i resuse the search functionality,,,Please help me
thumbnail
Ravi Kumar Gupta, módosítva 8 év-val korábban

RE: I want to use Search functionality of Document and Media in custom port

Liferay Legend Bejegyzések: 1302 Csatlakozás dátuma: 2009.06.24. Legújabb bejegyzések
Assuming you know how to write a portlet, if you don't, please check the documentation once.

Use Liferay core APIs to perform search. That's how document and library is working. Download the source code of liferay and check how document and media portlet works. You need to understand how it works, then it will be easier.
Jaspal Sharma, módosítva 8 év-val korábban

RE: I want to use Search functionality of Document and Media in custom port

New Member Bejegyzések: 4 Csatlakozás dátuma: 2015.04.17. Legújabb bejegyzések
Thank you for your Response. Can you please suggest me how we will come to know API knowlede, since documents of the liferay are not much clear. also i have not developed any application using open source. Please Suggest me ,
thumbnail
Ravi Kumar Gupta, módosítva 8 év-val korábban

RE: I want to use Search functionality of Document and Media in custom port

Liferay Legend Bejegyzések: 1302 Csatlakozás dátuma: 2009.06.24. Legújabb bejegyzések
See this link: https://dev.liferay.com/develop/learning-paths/-/knowledge_base/6-2/beginning-liferay-development

And along with the development, keep an eye on portal source code. You can download portal source from sourceforge. http://sourceforge.net/projects/lportal/
Jaspal Sharma, módosítva 8 év-val korábban

RE: I want to use Search functionality of Document and Media in custom port

New Member Bejegyzések: 4 Csatlakozás dátuma: 2015.04.17. Legújabb bejegyzések
Thank You Ravi Sir..
thumbnail
Andew Jardine, módosítva 8 év-val korábban

RE: I want to use Search functionality of Document and Media in custom port

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
You could also embed the search portlet (portlet id = 3) with an advanced configuration where by you limit the scope of the asset entries to just the Document Library entities (FileEntry and Folder). You can use the advaced configuration to adjust the facets that will show up as well. Here is an example of the out of the box Advanced configuration, modified to show only doucment library models, and all facets.


{"facets": [
    {
        "displayStyle": "scopes",
        "static": false,
        "weight": 1.6,
        "order": "OrderHitsDesc",
        "data": {
            "maxTerms": 10,
            "frequencyThreshold": 1,
            "showAssetCount": true
        },
        "className": "com.liferay.portal.kernel.search.facet.ScopeFacet",
        "label": "site",
        "fieldName": "groupId"
    },
    {
        "displayStyle": "asset_entries",
        "static": false,
        "weight": 1.5,
        "order": "OrderHitsDesc",
        "data": {
            "values": [
                "com.liferay.portlet.documentlibrary.model.DLFileEntry",
                "com.liferay.portlet.documentlibrary.model.DLFolder",
            ],
            "frequencyThreshold": 1
        },
        "className": "com.liferay.portal.kernel.search.facet.AssetEntriesFacet",
        "label": "asset-type",
        "fieldName": "entryClassName"
    },
    {
        "displayStyle": "asset_tags",
        "static": false,
        "weight": 1.4,
        "order": "OrderHitsDesc",
        "data": {
            "displayStyle": "list",
            "maxTerms": 10,
            "frequencyThreshold": 1,
            "showAssetCount": true
        },
        "className": "com.liferay.portal.kernel.search.facet.MultiValueFacet",
        "label": "tag",
        "fieldName": "assetTagNames"
    },
    {
        "displayStyle": "asset_categories",
        "static": false,
        "weight": 1.3,
        "order": "OrderHitsDesc",
        "data": {
            "displayStyle": "list",
            "maxTerms": 10,
            "frequencyThreshold": 1,
            "showAssetCount": true
        },
        "className": "com.liferay.portal.kernel.search.facet.MultiValueFacet",
        "label": "category",
        "fieldName": "assetCategoryIds"
    },
    {
        "displayStyle": "folders",
        "static": false,
        "weight": 1.2,
        "order": "OrderHitsDesc",
        "data": {
            "maxTerms": 10,
            "frequencyThreshold": 1,
            "showAssetCount": true
        },
        "className": "com.liferay.portal.kernel.search.facet.MultiValueFacet",
        "label": "folder",
        "fieldName": "folderId"
    },
    {
        "displayStyle": "modified",
        "static": false,
        "weight": 1,
        "order": "OrderHitsDesc",
        "data": {
            "frequencyThreshold": 0,
            "ranges": [
                {
                    "range": "[past-hour TO *]",
                    "label": "past-hour"
                },
                {
                    "range": "[past-24-hours TO *]",
                    "label": "past-24-hours"
                },
                {
                    "range": "[past-week TO *]",
                    "label": "past-week"
                },
                {
                    "range": "[past-month TO *]",
                    "label": "past-month"
                },
                {
                    "range": "[past-year TO *]",
                    "label": "past-year"
                }
            ]
        },
        "className": "com.liferay.portal.kernel.search.facet.ModifiedFacet",
        "label": "modified",
        "fieldName": "modified"
    }
]}


Either way you should download the source for the portal to better understand the search API (as suggested). You should also download a tool called Luke (https://code.google.com/p/luke/downloads/list) which will allow you to query the index as you do a RDBMS tool. If you have not altered the stock configuration, your lucene data will be found in LIFERAY_HOME/data/lucene/<company_id>