Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-12493

Manage filter queries on search based on a model

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.9.1, 4.10.0
    • 4.9.0
    • None
    • None

      When launching a search based on a search model, we should be able to choose if our queries has to be added as queries or filter queries. It was possible in 4.8, but not since 4.9.

      On SearchModelContentSearcher :

      // Add this method
      
      /**
       * Add the filter queries
       * @param filterQueryStrings The filter queries
       * @return The ContentSearcher itself.
       */
      public SearchModelContentSearcher withFilterQueryStrings(List<String> filterQueryStrings)
      {
          _filterQueryStrings = filterQueryStrings;
          return this;
      }
      
      [...]
      
      // And use it in _searcher(values, facetValues, contextualParameters) method
      return _searcher
          .withFilterQueryStrings(_filterQueryStrings)
          [...];
      

      Also SearchValues should be able to receive filter queries like:

      // Declaration of the attribute
      List<String> _filterQueries;
      
      [...]
      
      // Add this in the constructor
      _parseFilterQueries();
      
      [...]
      
      // Declare these new methods
      private void _parseFilterQueries()
      {
          _filterQueries = (List<String>) _values.get("filterQueries");
      }
      
      /**
       * Get the filter queries.
       * @return the filter queries
       */
      public List<String> getFilterQueries()
      {
          return _filterQueries;
      }

            Unassigned Unassigned
            bmaurel Bérénice Maurel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: