We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30441
    • 10 Posts
    Hi,

    there is still a problem with searching in TVs.

    If you are searching for text in more than one TVs, it can’t find the correct entries.

    TV1="hi"
    TV2="huhu"

    search for "hi huhu", you get "nothing found".

    And is there any way to return a defined TV as part of the searchresult?

    cu
    Toranaga

      • 5811
      • 1,717 Posts
      @Toranaga

      And is there any way to return a defined TV as part of the search result?
      Unfortunately not. Adds the TV value as field returned by the FROM ... LEFT JOIN select statement will bring as much as records than the number of different TVs linked with a document record which match a search word. So for performance reasons, it is not planed today to display the content of the TVs. Just the document fields.

      Here is the current select statement done by the search:
      search "card word"  - useAllWords = '0', searchStyle = 'partial'
      
      SELECT DISTINCT sc.id, sc.pagetitle, sc.description, sc.content, sc.introtext, sc.longtitle 
      FROM `modx_site_content` sc 
      LEFT JOIN `modx_site_tmplvar_contentvalues` stc ON sc.id = stc.contentid  
      WHERE (
      (sc.pagetitle LIKE '%card world%' 
      OR sc.description LIKE '%card world%' 
      OR sc.content LIKE '%card%' OR sc.introtext LIKE '%card%' OR stc.value LIKE '%card%') 
      OR (sc.pagetitle LIKE '%card world%' OR sc.description LIKE '%card world%' 
      OR sc.content LIKE '%world%' OR sc.introtext LIKE '%world%' OR stc.value LIKE '%world%')

        • 11975
        • 2,542 Posts
        Hi,

        this could be done by getting only the ids from the search Query and then execute ditto to grab the required fields.

        :-)
          Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
          • 30441
          • 10 Posts
          @coroico

          Thanks,

          but ’useallwords=0’ is an OR no AND. Therefore the result ist incorrect.


          @heliotrope
          good idea, I will try. Thank you.

          cu
          Toranaga


            • 5811
            • 1,717 Posts
            @Heliotrope

            this could be done by getting only the ids from the search Query and then execute ditto to grab the required fields
            Use ditto to compensate the lack of a feature in ajaxSearch (display of tv values) is IMHO a little bit excessive and probably not performant

            From my point of view the main problem come from that ajaxSearch use a left join statement to search in the TV table. Adding stc.value in the returned list of values bring as much as lines as TVs linked with the document. So I think that rather to use:
            SELECT DISTINCT sc.id, sc.pagetitle, sc.description, sc.content, sc.introtext, sc.longtitle 
            FROM `modx_site_content` sc 
            LEFT JOIN `modx_site_tmplvar_contentvalues` stc ON sc.id = stc.contentid  
            WHERE ( sc.pagetitle LIKE '%card' 
            OR sc.description LIKE '%card' 
            OR sc.content LIKE '%card%' 
            OR sc.introtext LIKE '%card%' 
            OR stc.value LIKE '%card%');


            it could be better to use a union statement like this:
            SELECT sc.id, sc.pagetitle, sc.description, sc.content, sc.introtext, sc.longtitle, stc.value
            FROM `modx_site_content` sc, `modx_site_tmplvar_contentvalues` stc 
            WHERE stc.value LIKE '%card%'
            AND sc.id = stc.contentid
            UNION 
            SELECT sc.id, sc.pagetitle, sc.description, sc.content, sc.introtext, sc.longtitle, ""
            FROM `modx_site_content` sc
            WHERE ( sc.pagetitle LIKE '%card' 
            OR sc.description LIKE '%card' 
            OR sc.content LIKE '%card%' 
            OR sc.introtext LIKE '%card%')
            AND NOT
            EXISTS (
            SELECT stc.value
            FROM `modx_site_tmplvar_contentvalues` stc
            WHERE stc.value LIKE '%card%'
            AND sc.id = stc.contentid
            )
            ORDER BY value;
            This will allow to display the content of TV values.

            I will test this kind of solution and the performance impacts with the next 1.8 version of ajaxSearch
              • 11975
              • 2,542 Posts
              Hi,

              I understand your concern about performance issue but Ditto 2.0 has some great features (such as PHx support) and has reduced the db queries amount to the minimum.

              tvExplorer uses both AS and Ditto in this way.


              :-)

                Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                • 12262
                • 40 Posts
                Hello,

                found a small typo in german.inc.php:

                $_lang[’as_resultsFoundTextMultiple’] = ’%d Ergebnisse gefunden fürr "%s".’;

                --> remove the double "rr"
                $_lang[’as_resultsFoundTextMultiple’] = ’%d Ergebnisse gefunden für "%s".’;


                Thomas
                  • 5811
                  • 1,717 Posts
                  Thanks Thomas for this feedback. Have you the last release of ajaxSearch (1.7.0.2). ? This typo has been corrected in the version 1.7.
                    • 30441
                    • 10 Posts
                    Hm,

                    feature or bug? Ajaxsearch doesn’t respect the hiddenflag.

                    Documents flaged with hidden should only be shown in the result list, if the user wants to.

                    Ok, I know the searchable flag, but I like to have this option, because some parts of the site should have a partsearch and the documents there should not be seen in he normal search.

                    I could insert it by myself, but I think it is better to have it in the main archiv.

                    cu
                    Toranaga
                      • 25663 MODX Staff
                      • 12,272 Posts
                      Toranaga, the fastest way to get it inserted is to post a patch here and it should find it’s way into the main branch.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me

                      This discussion is closed to further replies. Keep calm and carry on.