<![CDATA[ Advsearch Problem after upgrading to Modx 2.2 - My Forums]]> https://forums.modx.com/thread/?thread=73383 <![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2?page=2#dis-post-563723
I know it's old post but problem is in getIds snippet. It takes actual default context, and doesn`t have option to change or choose content. You need to edit snippet code. Check this.
https://docs.modx.com/revolution/2.x/developing-in-modx/other-development-resources/class-reference/modx/modx.getchildids]]>
godzio Jan 23, 2019, 12:34 PM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2?page=2#dis-post-563723
<![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2?page=2#dis-post-483988 {code}
[[!AdvSearch ]]
{code}
it searches in default web context. If search fails, it outputs 'There were no search results...'. So it looks working.

Whenever I add any option to advsearch snippetcall, either &queryHook or &contexts or &ids, it outputs nothing. No errors, no messages, nothing. It should be a php error somewhere but nginx error logs show no errors. How to digg it?

I need it to get working on a multicontext website or find another multicontext search engine.]]>
remort Nov 26, 2013, 10:38 AM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2?page=2#dis-post-483988
<![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2?page=2#dis-post-483989
[[!AdvSearch ]]

it searches in default web context. If search fails, it outputs 'There were no search results...'. So it looks working.

Whenever I add any option to advsearch snippetcall, either &queryHook or &contexts or &ids, it outputs nothing. No errors, no messages, nothing. It should be a php error somewhere but nginx error logs show no errors. How to digg it?

I need it to get working on a multicontext website or find another multicontext search engine.]]>
remort Nov 26, 2013, 10:38 AM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2?page=2#dis-post-483989
<![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2?page=2#dis-post-483676
I still can't get it working on a multilanguage website with babel.
Modx 2.2.10-pl , advsearch 1.0.1-pl.

-mbstring is enabled
-zend libraries are installed
-GetIds is installed
-web context is empty, i use rucnt,encnt contexts for ru and en languages. every context have some containers with items i need to do a search between. Not a single container per context but 3 containers in every context 7,8,9 for rucnt , 33,38,39 in encnt.
-i am trying to search according just one TV - bedrooms just for get it working

these are the snippet calls and chunk
[[!AdvSearch 
&queryHook=`FilterHook`
&ids=`[[!GetIds? &ids=`c7,c8,c9,c33,c38,c39`]]`
&contexts=`encnt`
&queryHook=`FilterHook`
&includeTVs=`district,price,distance,bedrooms,market,squaremeters,object_id` 
&withTVs=`bedrooms`
]]

[[!AdvSearchForm? &landing=`75` &method=`GET` &help=`0` &tpl=`AdvancedSearchForm`]]


FilterHook:
<?php
$andConditions = array(
  'tv.bedrooms:=' => 'bedrooms:request:all'

);

$qhDeclaration = array(
  ‘qhVersion’ => ‘1.2’,
  'andConditions' => $andConditions
);

$hook->setQueryHook($qhDeclaration);
return true;



AdvancedSearchForm chunk
                    <form class="advsea-search-form" id="advancedsearchform" action="[[~[[+landing]]]]" method="[[+method]]">
                              <input type="hidden" name="id" value="[[+landing]]" />
                              <input type="hidden" name="asId" value="[[+asId]]" />

                              <label>Bedrooms
                              <select name="bedrooms">
                                <option value="all" selected="selected"></option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                              </select></label>

                                <input type="submit" name="sub" value="[[%advsearch.search? &namespace=`advsearch` &topic=`default`]]" />
                                <!-- <input type="submit" id="findbutton" name="findbutton" value="Search"> -->
        		</form>
[[+resultsWindow]]


It outputs nothing. No matter how i try. With/without &contects, with/without &ids options.

But when i place some items inside an empty 'web' contexts and clear all the snippet options (just use [[!AdvSearch]] and [[!AdvSearchForm]] ). It shows these objects, but without filtering. Just outputs all the objects i placen inside a web context. That's because snippet caals doesn't contain &queryHook option. Whenever i try to use any options on snippet calls, it starts output nothing.

And i cant understand why we should use &ids option. As it mentioned in documentation - it allows to eclude documents from being searchrd. I don't need to exlude any document from search results. Should i list documents from opposite context here and do not list current context documents?

And, for the future use, where i should place the landing page? Should i create an independent landing page for every context?

PS: I saw this example (http://www.revo.wangba.fr/multi-languages.html). It didn't lead me anywhere. Its mainly about how to traslate the Form. And i need just to get thinks working at first.]]>
remort Nov 22, 2013, 07:55 AM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2?page=2#dis-post-483676
<![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-470915 ]]> markushh Jul 05, 2013, 09:40 AM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-470915 <![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-467743
i have a problem with the tpl-parameters. if i use this little call everything is fine:

[[!AdvSearchForm? 
&help=`0`
&addJs = `0`
&addCSS = `0`
&addJQuery = `0`
]]

[[!AdvSearch?
&pagingType=`2`]]


but when i add my own chunk for the results or for the extract the page don't displays any results. even if my chunks are a simple copy of the default.

[[!AdvSearch?
&pagingType=`2`
&tpl=`chunk.SearchResults`
&extractTpl=`chunk.Extract`]]


did you ever had problems like this?

thx,
hhm


]]>
markushh May 31, 2013, 10:53 AM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-467743
<![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-411706 I install:
AdvSearch 1.0.0 pl2
GetIds 1.0 pl
Zend 1.11
jquery-1.7.1.min.js
UTF-8 charset

on MODX Revolution 2.2.0-pl2 (traditional)

but AdvSearch request with &withAjax=`1` don`t work.
Simple request ( &withAjax=`0`) - it worked perfectly.

All I see when requesting withAjax=1, is waiting for the animation.Then nothing happens.
My code
[[!AdvSearchForm? 
  &withAjax=`1`
  &ajaxResultsId=`5`
  &addJQuery=`0` //connection separately
]]
[[!AdvSearch? 
  &ids=`[[!GetIds? &ids=`c5`]]`  
  &perPage=`10`
  &withTVs=`tags` 
  &includeTVs=`tags`
  &tpl=`myAdvSearchResult`
  &withFields=``
  &fields=`pagetitle,longtitle,link,id`
  &withAjax=`1`
]]
]]>
torasike Feb 13, 2012, 09:29 AM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-411706
<![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-411051 howster Feb 08, 2012, 05:04 AM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-411051 <![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-410884 Look after: http://www.revo.wangba.fr/multi-languages.html

[[!AdvSearchForm? &tpl=`mlSearchForm`]]
By default the current is used inside mlSearchForm. So by using:
[[%select_category? &namespace=`wangba` &topic=`default`]]
you get the correct label before the list box. Here the options of the listbox are not linked with the current context. wangba is a namespace for all the labels of the site. Look after the files mlSearchForm and mlSearchResult.

For the results :
&ids=`[[!GetIds? &ids=`c38,c39`]]` 
You need to specify all the id notes whatever the language used.

c38 => english documents under the "web" context
c39 => french documents under the "french" context

As for mlSearchForm, mlSearchResult use the current context to set up the appropriate labels:
    <div><span class="flash">[[%category? &namespace=`wangba` &topic=`default`]]:</span> [[+articleCategory]]</div>
    <div><span class="flash">[[%tags? &namespace=`wangba` &topic=`default`]]:</span><ul> [[+articleTags]]</ul></div>
    <div><span class="flash">[[%mark? &namespace=`wangba` &topic=`default`]]:</span> [[+articleMark]]</div>


&contexts=`french` 

I don't know why (for the moment) but you need to specify &contexts=`french` with the french search to search only inside the french documents (below c39). I thought that it was by default the current context. I need to check why this is not the case.

Hope this demo help you.]]>
coroico Feb 07, 2012, 06:41 AM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-410884
<![CDATA[Re: Advsearch Problem after upgrading to Modx 2.2]]> https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-410698
Quick question! I have a multi language site with multiple language contexts en,fr,de,ru etc...On my search results page I try to use a condition with advsearch but it just doesn't work wrapped in a conditional:

This works standalone:
[[!AdvSearch? 
  &ids=`[[!GetIds? &ids=`c147`]]` 
  &tpl=`salesSearchResult`
 &contexts=`web` 
 &perPage=`10` 
&pagingType=`2`
  &queryHook=`sales-hook` 
  &withTVs=`property_type,bedrooms` 
  &includeTVs=`property_area,property_price,service_type,property_ref,property_p_image,bathrooms,sq_ft`
  &sortby=`bedrooms` 
]]


Trying to get this working i.e. different search results based on context:

[[!If?
   &subject=`[[*context_key]]`
   &operator=`EQ`
   &operand=`web`
   &then=`

[[!AdvSearch? 
  &ids=`[[!GetIds? &ids=`c147`]]` 
  &tpl=`salesSearchResult`
 &contexts=`web` 
 &perPage=`10` 
&pagingType=`2`
  &queryHook=`sales-hook` 
  &withTVs=`property_type,bedrooms` 
  &includeTVs=`property_area,property_price,service_type,property_ref,property_p_image,bathrooms,sq_ft`
  &sortby=`bedrooms` 
]]
`]]

[[!If?
   &subject=`[[*context_key]]`
   &operator=`EQ`
   &operand=`ru`
   &then=`

[[!AdvSearch? 
  &ids=`[[!GetIds? &ids=`c318`]]` 
  &tpl=`salesSearchResult`
 &contexts=`ru` 
 &perPage=`10` 
&pagingType=`2`
  &queryHook=`sales-hook` 
  &withTVs=`property_type,bedrooms` 
  &includeTVs=`property_area,property_price,service_type,property_ref,property_p_image,bathrooms,sq_ft`
  &sortby=`bedrooms` 
]]
`]]


I have search results pages like:

www.xyz.com/results
www.xyz.com/fr/results
www.xyz.com/ru/results...

each one with different results as they are in different languages and hence different containers in modx.

I also tried using output modifiers in case the IF extra was the cause. Any ideas please how to use advsearch in conditionals. Both work fine standalone.

THANKS!
]]>
howster Feb 06, 2012, 12:09 AM https://forums.modx.com/thread/73383/advsearch-problem-after-upgrading-to-modx-2-2#dis-post-410698