I'm trying to use the jquery plugin to load different views of a search, e.g. A search for apples populates view 1 with regular results, and view 2 only with results tagged with 'featured'. I have gotten this working locally, but when running on my cloud implementation the results from view 1 are being shown in view 2.
The cache div's aren't the same, and i've tried making the id's unique anyway which didn't change behavior. I noticed that the page view count property is being honored, so featured results will return the limit (say, 3), when it should be returning less (there is only one result with a 'featured' tag).
Can i get some help with why i'm getting different results in these circumstances?
Do you have a code sample (e.g., a Gist, CodePen, or Glitch) to look at? It's a little hard to say without any actual code in front of us, sorry (especially puzzling that it would work locally but not on prod!)
<form>
<input type="text" placeholder="Search" id="st-search-input" />
</form>
<div>
<div><h3>These are featured results:</h3></div>
<div id="featured-results-container"></div>
</div>
<br>
<div>
<div><h3>These are not featured results:</h3></div>
<div id="regular-results-container"></div>
</div>
Since the featured results are being populated by the non-featured results, i first thought it was a local cache issue, but checking the cache divs revealed nothing. Noteworthy to me is the perPage field, which is behaving correctly in either environment, making me think of a server side cache race condition.
The target production environment is on AEM and Wordpress sites. AEM serving an html page with this code is where i am experiencing this issue.
Thanks for the code snippet! I dug into our Site Search jQuery repo a bit more and it looks like we don't actually have any examples / may not technically support having multiple calls of .swiftypeSearch() per input/per page. @JasonStoltz, can you confirm whether this is a supported or unsupported part of the plugin?
Re: jQuery library setup - very possibly the case, yeah Unfortunately it's an older plugin that predates my time at Elastic, so I'm not sure where we're at on current planned development for it.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.