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

    I found the issue started with the way the meta dscription was done.
    I used a common way to extract 300car. from the content. For some reason I'm still not able to understand, I found the only way to clear the issue with ADVS (and some other snippets too) is to use this modifiers string
    [[*content:limit=`600`:strip_tags:escape]]


    Well now need to output result in French... [ed. note: elz064 last edited this post 12 years, 3 months ago.]
      • 12410
      • 353 Posts
      Hi Guys
      Trying in vain to get this demo working: http://www.revo.wangba.fr/faceted-search-6.html
      I'd like to have a dropdown for property type i.e. house.apartment,shed that gets populated from a TV called property-type and a comparison dropdown say min pice and max price (populated from TV price)and a search button that lands the results on say page ID 100.
      Usin Modx 2.2 and latest advsearch extra. Tad baffled by the docs! Starting out!

      If I could output:
      Name of property
      Price

      it would be great to get me started. Form and Query Hook and chunk syntax.
      THANKS
        • 5811
        • 1,717 Posts
        The closest demo is probably the demo 2: http://www.revo.wangba.fr/faceted-search-2.html

        Now, you could find the searchForm file used beside the queryHook file.

        The articleSearchResult template is:
        <div class="advsea-result">
            <h3>[[+idx]]. <a href="[[+link:is=``:then=`[[~[[+id]]]]`:else=`[[+link]]`]]" title="[[+longtitle]]">[[+pagetitle]]</a></h3>
            <div class="imgArticle"><img src="assets/images/articles/[[+articleImage]]" height="120px" /></div>
            <div>[[+extracts]]</div>
            <div><span class="flash">Subject:</span> [[+articleCategory]]</div>
            <div><span class="flash">Tags:</span><ul> [[+articleTags]]</ul></div>
            <div><span class="flash">Mark:</span> [[+articleMark]]</div>
        </div>


        You could find all the information on how to set up this kind of form on the documentation page. See the advSearchHook documentation and download the queryHook examples zip file
          • 12410
          • 353 Posts
          Thanks got it working. Great Extra! I needed to download Getids
            • 38982
            • 13 Posts
            I can't find the indexation.php file anywhere. Am I being stupid? I would really like to use the 'all' mode but can't figure out how to index it. I've looked on the Zend documentation, but it goes into a lot more detail that I understand.

            Are you going to implement indexing functionality into a snippet/chunk at some point?

            David
              • 19328
              • 433 Posts
              I'm using AdvSearch and it's great. However, I recently found that I'm getting the following error when performing a search. I do get results back though and it seems to work fine.

              [2012-03-22 15:14:16] (ERROR @ xxxxx/public_html/core/components/advsearch/model/advsearch/advsearchresults.class.php : 588) PHP warning: array_multisort() [<a href='function.array-multisort'>function.array-multisort</a>]: Array sizes are inconsistent


              These are my snippet calls:
              [[!AdvSearchForm? 
              &searchIndex=`zoekterm`
              &tpl=`AdvSearchFormFilters`
              ]]
              
              [[!AdvSearch?
              &hideContainers=`1`
              &withFields=`pagetitle,introtext,content`
              &withTVs=`straatEnNummer,belangrijkeInfo,categorieKeuze,leeftijdsgroepen,tags`
              &fieldPotency=`pagetitle:50,introtext:30,tags:40,content:30`
              &highlightTag=`strong`
              &searchIndex=`zoekterm`
              &engine=`mysql`
              &queryHook=`zoekFilters`
              &pagingType=`2`
              &pagingSeparator=``
              &showExtract=`1:introtext,content`
              &ids=`[[!GetIds? &ids=`c133,c134,c135`]]`
              ]]


              Chunk for the search form (AdvSearchFormFilters):
              <form id="[[+asId]]_advsea-form" class="advsea-form searchFull" action="[[~[[+landing]]]]" method="[[+method]]">
                <fieldset>
                  <input type="hidden" name="id" value="[[+landing]]" />
                  <input type="hidden" name="asId" value="[[+asId]]" />
                  <input type="text" id="[[+asId]]_advsea-search" name="[[+searchIndex]]" value="[[+searchValue]]" />
                  [[+liveSearch:isnot=`1`:then=`<input type="submit" id="[[+asId]]_advsea-submit"  name="sub" value="Zoek" />`]]
              
                  
                  <div class="zoekfilters">Zoek in: 
                    <input type="radio" [[!zoekFilterChecked? &deel=`alles`]] value="alles" name="onderdeel" id="onderdeel_alles" /><label for="onderdeel_alles"> Alles</label>
                    <input type="radio" [[!zoekFilterChecked? &deel=`agenda`]] value="agenda" name="onderdeel" id="onderdeel_agenda" /><label for="onderdeel_agenda"> Agenda</label>
                    <input type="radio" [[!zoekFilterChecked? &deel=`aanbieders`]] value="aanbieders" name="onderdeel" id="onderdeel_aanbieders" /><label for="onderdeel_aanbieders"> Aanbieders</label>
                    <input type="radio" [[!zoekFilterChecked? &deel=`nieuws`]] value="nieuws" name="onderdeel" id="onderdeel_nieuws" /><label for="onderdeel_nieuws"> Nieuws</label>
                 
                  </div> 
                  
                </fieldset>
              </form>
              
              [[+resultsWindow]]


              Queryhook snippet (zoekFilters):
              $tag = 'onderdeel';
              $area = (isset($_REQUEST[$tag])) ? strip_tags($_REQUEST[$tag]) : 'en';
              
              // get the list of ids with GetIds
              if ($area == 'agenda') { 
                $parent = '134';
              } else if ($area == 'nieuws') { 
                $parent = '135';
              } else if ($area == 'aanbieders') {
                $parent = '133';
              } else { 
                $parent = '0';
              }
              
              $ids = $modx->getChildIds($parent, 10); //get the array of ids of the children resources
              $lstids = implode(',',$ids);
              
              if ($area == 'agenda') {
                $andConditions = array(
                    'modResource.id:IN' => $lstids . ':integer',
                    'link_attributes:>' => time()
                );
              } else {
              
                $andConditions = array(
                    'modResource.id:IN' => $lstids . ':integer'
                );
                  
              }
              
              $qhDeclaration = array(
                  'qhVersion' => '1.1',
              	'andConditions' => $andConditions
              );
              
              $hook->setQueryHook($qhDeclaration);
              return true;


              Am I doing something wrong here that's producing the error message?

              And another thing I noticed is that when using quotation marks in the search query ("") the search term is not placed in the input field of the search form.

              Thanks for any help!
                • 5811
                • 1,717 Posts
                I recently found that I'm getting the following error when performing a search. I do get results back though and it seems to work fine.
                This is a warning. By using
                &fieldPotency=`pagetitle:50,introtext:30,tags:40,content:30`

                The results should be sorted with the fields pagetitle,introtext,content (all are defined site_content fields) but also with the TV "tags" values. And probably one of your document has no tags TV value. So the size of array tags is different.

                And another thing I noticed is that when using quotation marks in the search query ("") the search term is not placed in the input field of the search form.
                Thanks for this feedback. I never noticed this before. I will add an issue inside Github
                  • 38982
                  • 13 Posts
                  Where can I get this indexation.php script that people were talking about earlier in this thread?

                  David
                    • 5811
                    • 1,717 Posts
                      • 38537
                      • 34 Posts
                      Hey there, so I have some issues, too.
                      I've really need the dynamic content feature, 'cause the site I've made is really big and used a lot of TVs for content.

                      I tried to index all ressources with the indexation.php, but I became the follwing error.
                      Indexation strating ... 
                      Fatal error: Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Index doesn't exists in the specified directory.' in /customer/35663/web/mysite/assets/libraries/Zend/Search/Lucene.php:566 Stack trace: #0 /customer/35663/web/mysite/assets/libraries/Zend/Search/Lucene.php(225): Zend_Search_Lucene->__construct('/kunden/356639_...', false) #1 /customer/35663/web/mysite/indexation.php(175): Zend_Search_Lucene::open('/customer/35663...') #2 {main} thrown in /customer/35663/web/mysite/assets/libraries/Zend/Search/Lucene.php on line 566


                      I changed the $ids in line 22 and I cchanged the $url in line 64.
                      Is there any other things to do?

                      Hope for your help.

                      Kind regards,
                      z.