Details

      Description

      some steps to reproduce:
      1. get ezFind working

      2. customize some class for search:

      • at any class (article is good), add an attribute named "extrasolrfield" of type textline, and mark it searchable
      • create a new object of that class, insert in the "extrasolrfield" some sentence with a "relavant" word for search. with the typo, to make the word unique and save work later
      • search it in front end, just to assure there is a single object as result

      3. customize ezsearch template:

      • open the ezfind/design/ezdemo/templates/search.tpl file
      • modify the fetch operator to include the field.
        it becomes:

            {set $search=fetch( ezfind,search,
                                hash( 'query', $search_text,
                                      'offset', $view_parameters.offset,
                                      'limit', $page_limit,
                                      'sort_by', hash( 'score', 'desc' ),
                                      'facet', $defaultSearchFacets,
                                      'as_objects', false(),
                                      'fields_to_return', array( 'attr_extrasolrfield_s'),
                                      'filter', $filterParameters,
                                      'publish_date', $dateFilter,
                                      'spell_check', array( true() ),
                                      'search_result_clustering', hash( 'clustering', false() ) )
                                     )}
            {$search|dump('show',4)}
        

        note: the option "asObjects" is incorrect, it needs also to be modified to "as_objects"

      5. run test:

      • in frontend, search for the "relavant" word that should give 1 result
      • check in the dump result that the array "fields" is not present as expected.

      the "fields" should be included, according to comment in eZSolr::buildResultObjects():

                              // check if field is not in the explicit field list, to keep explode from generating notices.
                              // it may be a field originating from the explicit fieldlist to return, so it should be added for template consumption
                              // note that the fieldname will be kept verbatim in a substructure 'fields'
      

        Issue Links

          Activity

          Hide
          Paulo Bras (Inactive) added a comment - - edited

          some steps to reproduce:
          1. get ezFind working

          2. customize some class for search:

          • at any class (article is good), add an attribute named "extrasolrfield" of type textline, and mark it searchable
          • create a new object of that class, insert in the "extrasolrfield" some sentence with a "relavant" word for search. with the typo, to make the word unique and save work later
          • search it in front end, just to assure there is a single object as result

          3. customize ezsearch template:

          • open the ezfind/design/ezdemo/templates/search.tpl file
          • modify the fetch operator to include the field.
            it becomes:

                {set $search=fetch( ezfind,search,
                                    hash( 'query', $search_text,
                                          'offset', $view_parameters.offset,
                                          'limit', $page_limit,
                                          'sort_by', hash( 'score', 'desc' ),
                                          'facet', $defaultSearchFacets,
                                          'as_objects', false(),
                                          'fields_to_return', array( 'attr_extrasolrfield_s'),
                                          'filter', $filterParameters,
                                          'publish_date', $dateFilter,
                                          'spell_check', array( true() ),
                                          'search_result_clustering', hash( 'clustering', false() ) )
                                         )}
                {$search|dump('show',4)}
            

            note: the option "asObjects" is incorrect, it needs also to be modified to "as_objects"

          5. run test:

          • in frontend, search for the "relavant" word that should give 1 result
          • check in the dump result that the array "fields" is not present as expected.

          the "fields" should be included, according to comment in eZSolr::buildResultObjects():

                                  // check if field is not in the explicit field list, to keep explode from generating notices.
                                  // it may be a field originating from the explicit fieldlist to return, so it should be added for template consumption
                                  // note that the fieldname will be kept verbatim in a substructure 'fields'
          

          Show
          Paulo Bras (Inactive) added a comment - - edited some steps to reproduce: 1. get ezFind working 2. customize some class for search: at any class (article is good), add an attribute named "extrasolrfield" of type textline, and mark it searchable create a new object of that class, insert in the "extrasolrfield" some sentence with a "relavant" word for search. with the typo, to make the word unique and save work later search it in front end, just to assure there is a single object as result 3. customize ezsearch template: open the ezfind/design/ezdemo/templates/search.tpl file modify the fetch operator to include the field. it becomes: {set $search=fetch( ezfind,search, hash( 'query', $search_text, 'offset', $view_parameters.offset, 'limit', $page_limit, 'sort_by', hash( 'score', 'desc' ), 'facet', $defaultSearchFacets, 'as_objects', false(), 'fields_to_return', array( 'attr_extrasolrfield_s'), 'filter', $filterParameters, 'publish_date', $dateFilter, 'spell_check', array( true() ), 'search_result_clustering', hash( 'clustering', false() ) ) )} {$search|dump('show',4)} note: the option "asObjects" is incorrect, it needs also to be modified to "as_objects" 5. run test: in frontend, search for the "relavant" word that should give 1 result check in the dump result that the array "fields" is not present as expected. the "fields" should be included, according to comment in eZSolr::buildResultObjects(): // check if field is not in the explicit field list, to keep explode from generating notices. // it may be a field originating from the explicit fieldlist to return, so it should be added for template consumption // note that the fieldname will be kept verbatim in a substructure 'fields'
          Show
          Yannick Roger (Inactive) added a comment - PR: https://github.com/ezsystems/ezfind/pull/191
          Show
          Yannick Roger (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezfind/commit/b2af3dd4143a34a293270617ebba4265bb27c359
          Hide
          Miguel das Neves Jacinto (Inactive) added a comment -

          QA Approved
          tested on 5.3, 5.4 and master

          Show
          Miguel das Neves Jacinto (Inactive) added a comment - QA Approved tested on 5.3, 5.4 and master

            People

            • Assignee:
              Unassigned
              Reporter:
              Henning Kvinnesland
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: