Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Epic/Theme:
    • Story Points:
      6
    • Similar Issues:
      Show 5 results 

      Description

      Use the following code

      String defaultAssetcategoryIds = "1693623,1693624,1693625";
      
      List<Document> documents = null;
      SearchContext searchContext = SearchContextFactory.getInstance(origrequest);
      searchContext.setCompanyId(themeDisplay.getCompanyId());
      searchContext.setGroupIds(new long[] {themeDisplay.getScopeGroupId()});
      searchContext.setLocale(themeDisplay.getLocale());
      searchContext.setTimeZone(themeDisplay.getTimeZone());
      searchContext.setKeywords(q);
      						 	
      searchContext.setAssetCategoryIds(StringUtil.split(defaultAssetcategoryIds,0L));
      						 
      searchContext.setEnd(20);
      searchContext.setStart(0);
      String[] entryCalssName = {JournalArticle.class.getName()};
      searchContext.setEntryClassNames(entryCalssName);
      						
      Hits hits = indexer.search(searchContext);
      documents = hits.toList();

      in a portlet and notice that ALL documents return and not just the ones specified via AssetCategoryIds.

      NOTE: Categories will need to be created and their IDs will need to be played in defaultAssetcategoryIds

        Activity

        Hide
        Harrison Schueler (Inactive) added a comment -

        When the facets are being created it will read in some of the searchContext values fine but will read others as null (such as assetcategoryid's)
        at BooleanClause facetClause = facet.getFacetClause();

        Show
        Harrison Schueler (Inactive) added a comment - When the facets are being created it will read in some of the searchContext values fine but will read others as null (such as assetcategoryid's) at BooleanClause facetClause = facet.getFacetClause();
        Hide
        Sharry Shi added a comment - - edited

        PASSED Manual Testing using the following steps:

        1. Go to Control Panel to add a Categories.
        2. Record the categoryId in table assetcategory by using Navicat for Mysql.
        3. Edit the attached portlet to fit your test version, edit the test.java file to specify searching scope, make it as a plugin.
        4. Add an article with the added category, add another basic article, both have the same content "Article".
        5. Deploy the war file in step3.
        6. Search the article's content using the deployed plugin.

        Reproduced on:
        Tomcat 7.0 + MySQL 5. Portal 6.1.20. EE GA2.

        ALL article return in the searching result list, not just the ones specified via AssetCategoryIds.

        Fixed on:
        Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 5a6eb5a6b96a02ed5c2bcb6943b73dac539cce1e.
        Tomcat 7.0 + MySQL 5. Portal 6.1.x.EE GIT ID: df58e1a5992c3ca9fc10862629f047369e958cff.
        Plugins 6.1.x EE GIT ID: a0b2e0d9ad867c198275cc5295a5b73f50490df4.

        Only the article specified via AssetCategoryIds shows in the searching result list.

        Show
        Sharry Shi added a comment - - edited PASSED Manual Testing using the following steps: Go to Control Panel to add a Categories. Record the categoryId in table assetcategory by using Navicat for Mysql. Edit the attached portlet to fit your test version, edit the test.java file to specify searching scope, make it as a plugin. Add an article with the added category, add another basic article, both have the same content "Article". Deploy the war file in step3. Search the article's content using the deployed plugin. Reproduced on: Tomcat 7.0 + MySQL 5. Portal 6.1.20. EE GA2. ALL article return in the searching result list, not just the ones specified via AssetCategoryIds. Fixed on: Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 5a6eb5a6b96a02ed5c2bcb6943b73dac539cce1e. Tomcat 7.0 + MySQL 5. Portal 6.1.x.EE GIT ID: df58e1a5992c3ca9fc10862629f047369e958cff. Plugins 6.1.x EE GIT ID: a0b2e0d9ad867c198275cc5295a5b73f50490df4. Only the article specified via AssetCategoryIds shows in the searching result list.
        Hide
        Sharry Shi added a comment -

        I had attached the specific Plugin that I had using in my testing.

        Show
        Sharry Shi added a comment - I had attached the specific Plugin that I had using in my testing.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 44 weeks, 2 days ago

              Development

                Structure Helper Panel