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

    there is a new switch "&hidemenu".

    0= shows only unhidden documents
    1= shows only hidden documents
    >=2 shows anything whether hidden or unhidden

    Changes have "// respect hidemenu" as mark, only changed files in the archive.

    only testet with NoAjax.

    cu
    Toranaga

      • 5811
      • 1,717 Posts
      Thanks Toranaga for this contribution

      With the ajax mode the hidemenu parameter should to be passed to javascript and then to ajaxSearch.php to do the right call to the dosearch function. l will do the necessary updates for this mode.

      Regarding the update of the dosearch function, i suggest to get out the $hidemenu switch to avoid to duplicate the code for the partial part and for relevant part (unused today - I will clean this part in the future). Find enclosed my meaning.

      I will test the change and i will deliver a new release 1.7.0.3 to the repository tomorrow
        • 30441
        • 10 Posts
        Could it be, that the longtitel is not really used in the search? Or did I kill the searchfunction?

        Tried with "abcd" in pagetitle and "efgh" in longtitle in the same document. Search with "abcd" gave a result, "efgh" gave no result.

        cu

        Toranaga
          • 5811
          • 1,717 Posts
          You are rigth ! the longtitle is not used in the search !

          The sql statement for searching card is:
          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%');
          So the longtitle is displayed but not used for search. I discover too this lack
          Thanks for this new feedback. I will update the dosearch function by adding this field in the search. Rather 1.7.0.3, with the &hidemenu parameter, i will probably deliver a 1.7.1 (new feature).
            • 30441
            • 10 Posts
            Will you fix the problem with the TVs too?

            cu
            Toranaga
              • 5811
              • 1,717 Posts
              Currently, I am working to deliver an efficient searchStyle parameter. So rather to offer an unused parameter searchStyle like partial or relevance (which doesn’t work), I prefer offer, as the extended search options of Google Search, the following options:

              SearchStyle : [exactphrase | allwords | nowords | oneword]

              - exactphrase : the exact searchstring is searched in all the relevant fields of the documents (pagetitle, longtitle, ..., TVs)
              - allwords : all the documents which contains all the words are provided
              - nowords: all the documents without all of these words are provided
              - oneword : all the documents with at least one word are provided. [default]

              In a second step I could offer the possibility to display to the end-user a (ajax) window to precise the option of the search (advanced search link)

              Here from the AS demo site in preparation, are the sql implementation for these options:

              oneword - searchString="school teacher"
              SELECT DISTINCT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.introtext, sc.content FROM `mod2_site_content` sc LEFT JOIN `mod2_site_tmplvar_contentvalues` stc ON sc.id = stc.contentid WHERE (sc.pagetitle LIKE '%school%' OR sc.longtitle LIKE '%school%' OR sc.description LIKE '%school%' OR sc.introtext LIKE '%school%' OR sc.content LIKE '%school%' OR stc.value LIKE '%school%') OR (sc.pagetitle LIKE '%teacher%' OR sc.longtitle LIKE '%teacher%' OR sc.description LIKE '%teacher%' OR sc.introtext LIKE '%teacher%' OR sc.content LIKE '%teacher%' OR stc.value LIKE '%teacher%') AND sc.id IN (63,64,65,66,67,68,69,70,71,72,73,97) AND sc.privateweb=0 AND sc.published=1 AND sc.searchable=1 AND sc.deleted=0 AND sc.hidemenu=0;

              Allwords - searchString="school teacher"
              SELECT DISTINCT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.introtext, sc.content FROM `mod2_site_content` sc LEFT JOIN `mod2_site_tmplvar_contentvalues` stc ON sc.id = stc.contentid WHERE (sc.pagetitle LIKE '%school%' OR sc.longtitle LIKE '%school%' OR sc.description LIKE '%school%' OR sc.introtext LIKE '%school%' OR sc.content LIKE '%school%' OR stc.value LIKE '%school%') AND (sc.pagetitle LIKE '%teacher%' OR sc.longtitle LIKE '%teacher%' OR sc.description LIKE '%teacher%' OR sc.introtext LIKE '%teacher%' OR sc.content LIKE '%teacher%' OR stc.value LIKE '%teacher%') AND sc.id IN (63,64,65,66,67,68,69,70,71,72,73,97) AND sc.privateweb=0 AND sc.published=1 AND sc.searchable=1 AND sc.deleted=0 AND sc.hidemenu=0;

              Exact phrase - searchString="Gender equality"
              SELECT DISTINCT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.introtext, sc.content FROM `mod2_site_content` sc LEFT JOIN `mod2_site_tmplvar_contentvalues` stc ON sc.id = stc.contentid WHERE (sc.pagetitle LIKE '%Gender equality%' OR sc.longtitle LIKE '%Gender equality%' OR sc.description LIKE '%Gender equality%' OR sc.introtext LIKE '%Gender equality%' OR sc.content LIKE '%Gender equality%' OR stc.value LIKE '%Gender equality%') AND sc.id IN (63,64,65,66,67,68,69,70,71,72,73,97) AND sc.privateweb=0 AND sc.published=1 AND sc.searchable=1 AND sc.deleted=0 AND sc.hidemenu=0;

              No words - searchString="education"
              SELECT DISTINCT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.introtext, sc.content FROM `mod2_site_content` sc LEFT JOIN `mod2_site_tmplvar_contentvalues` stc ON sc.id = stc.contentid WHERE (sc.pagetitle NOT LIKE '%education%' AND sc.longtitle NOT LIKE '%education%' AND sc.description NOT LIKE '%education%' AND sc.introtext NOT LIKE '%education%' AND sc.content NOT LIKE '%education%' AND stc.value NOT LIKE '%education%') AND sc.id IN (63,64,65,66,67,68,69,70,71,72,73,97) AND sc.privateweb=0 AND sc.published=1 AND sc.searchable=1 AND sc.deleted=0 AND sc.hidemenu=0;


              Thanks for your feedback regarding the interest of this new parameter.
              The consequence of this improvement will be the surrender of the "relevance" mode (which doesn’t run anyway)

              Regarding the TVs, the search occurs in the TVs (eg: stc.value LIKE ’%teacher%’) but as explained few posts below, to display the values of the TVs, I need to do some performances tests to know if the "union" sql statement solution presented below don’t decrease the performances.
              And I think >:( I will not have enougth time to do it before the delivery of MODX0.9.6.2 (which takes on board the AS Snippet) so I wil delivered the displaying of the TVs (if the solution is correct in terme of performances) in a 1.8 version (which is currently in preparation).
                • 30441
                • 10 Posts
                Ah you misunderstood.

                I ment the other thing with TVS. Not the ting with showing a special named TV as search result.

                "simply" correct seatching in the TVs.

                Dokument1 contains: TV1=abcd TV2=efgh
                Dokument2 contains: TV1=abc TV2=efgh
                Dokument3 contains: TV1=abcd TV2=efg

                useallwords=1 because we want a boolean AND

                Now a search for "abcd efgh" gives no result.

                This is not the expectet behavior and should be fixed or as "this doesn’t dont work" written in the docs.

                Maybe there is a load problem, but have you ever tried simple browsing in a site with modx with more than 2000 documents, its slow on a normal shared server, so I dont’ expect a F1 racecar in the search. The estimatet size of my site is ~10.000 documents, it will be slow regardless if it do searches false or true. But at the moment I see no other CMS which is capable doing my wishes.

                cu
                Toranaga




                  • 10449
                  • 956 Posts
                  I’m stumped here. I tried to make AJS run on the latest modx release, but always get:

                  SEARCH
                  There were no search results. Please try using more general terms to get more results.

                  I thought AJS would create a form for me automatically. Am I wrong in thinking this? I looked up the sample pages and I didn’t see any HTML for the search form, just the AjaxSearch snippet(s).


                  Here’s the techn. infos:

                  - ajaxSearch snippet version > latest (downloaded y’day)

                  - ajaxSearch snippet call of the page where is the search form > I thought the snippet would create the search form automatically?
                  I have the following:
                  {{ajs}}

                  chunk ajs =
                  <div id="search">
                  <!--search_terms-->
                  <span id="search-txt">SEARCH</span>
                  <a name="search"></a>
                  [!AjaxSearch? ajaxSearch=`0` &AS_landing=`249` &moreResultsPage=`249` &showMoreResults=`1` &addJscript=`0` &extract=`0` &AS_showResults=`0`!]
                  </div>

                  -> basically just a "classic" search without the Ajax.


                  - ajaxsearch snippet call of your landing or moreResults page
                  [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0` &grabMax=`10` &extract=`0`!]


                  - value of your search terms.
                  well, I don’t get a form, so there’s no search terms to begin with...

                  - where the searched term is. In a title/description/content of a public/private document or in a TV
                  see above

                  - charset of your html page
                  everything is UTF-8 (dbs etc. too)

                  - charset of your database
                  utf-8

                  - value of your $database_connection_charset variable in your /manager/includes/config.inc.php file
                  utf-8

                  - type of entity_encoding (Raw / Named) of your editor (TinyMCE, ...)
                  no WYSIWYG used

                  - browser type and version (IE, FireFox, Opera, Safari, ...)
                  latest stable FF, Win2K


                  I had an old version of AJS installed, but downloaded and overwritten the old one (1.5 iirc) with the new one (1.7.0.2).


                  I’m probably missing something stupid here, but still... I’ve used AjaxSearch in the past and it all worked nicely from the get-go.
                    • 7231
                    • 4,205 Posts
                    The new version has a renamed folder. I think it is ajaxSearch instead of AjaxSearch (or the other way around). It may be looking for the template in the wrong dir.
                      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                      Something is happening here, but you don&#39;t know what it is.
                      Do you, Mr. Jones? - [bob dylan]
                      • 10449
                      • 956 Posts
                      I checked that already. I even renamed the old one to something like "_old_AjaxSearch_backup" to be sure...

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