> Between the pagination i have custom code.
> 
> How do I prevent the draft from showing up?


For best performance, you should filter based on the status field in the 
original query.

1. What version of FarCry are you using?
2. What database (and version) are you using?
3. What does the search() method (code) look like (that's where the status 
filter will likely go depending on what's in there)?
4. I'm assuming you're not using Solr or Verity?  Just querying the DB directly?

--
Jeff Coughlin

On Mar 23, 2013, at 6:50 PM, Marco van den Oever <[email protected]> 
wrote:

> Hi all, I see that a draft item is showing up in the search results, I use 
> this code:
> 
> <cfsetting enablecfoutputonly="true">
> <!--- @@displayname: Simple Search Type Body --->
> <!--- @@author: Justin Carter ([email protected]) --->
> 
> <cfimport taglib="/farcry/core/tags/webskin" prefix="skin">
> <cfimport taglib="/farcry/core/tags/admin" prefix="admin" />
> 
> <cfparam name="url.q" default="">
> 
> <!--- do search --->
> <cfif url.q neq "Zoeken">
> <cfset stLocal.qResults = queryNew("objectid")>
> <cfif len(url.q)>
>     <cfset stLocal.qResults = search(url.q)>
> </cfif>
> </cfif>
> 
> <!--- <cfdump var="#stLocal.qResults#"> --->
> <!--- display search message --->
> <cfif url.q neq "Zoeken" and len(url.q) gt 3>
>     <cfoutput>
>         <p>Er <cfif stLocal.qResults.recordCount eq "0">zijn geen 
> zoekresultaten<cfelseif stLocal.qResults.recordCount eq "1">is één 
> zoekresultaat<cfelse>zijn #stLocal.qResults.recordCount# 
> zoekresultaten</cfif> gevonden voor "#url.q#".</p>
>     </cfoutput>
> <cfelse>
>     <cfoutput>
>         <p>Vul een zoekterm (meer dan 3 karakters) in het zoekveld en druk op 
> enter of klik op het vergrootglas.</p>
>     </cfoutput>
> </cfif>
> 
> 
> <!--- <cfdump var="#stLocal.qResults#"><cfabort> --->
> 
> 
> <!--- display results --->
> <cfif url.q neq "Zoeken" and len(url.q) gt 3>
> 
> 
> <!--- THIS MEANS PAGINATE --->
>     <skin:pagination query="#stLocal.qResults#" typename="dmNews" 
> paginationID="searchNews" recordsPerPage="10" pageLinks="10" 
> r_stobject="data">
> 
> Between the pagination i have custom code.
> 
> How do I prevent the draft from showing up?
> 
> Thanks!
> 
> -- 
> You received this message cos you are subscribed to "farcry-dev" Google group.
> To post, email: [email protected]
> To unsubscribe, email: [email protected]
> For more options: http://groups.google.com/group/farcry-dev
> --------------------------------
> Follow us on Twitter: http://twitter.com/farcry
> --- 
> You received this message because you are subscribed to the Google Groups 
> "farcry-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: [email protected]
To unsubscribe, email: [email protected]
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
--- 
You received this message because you are subscribed to the Google Groups 
"farcry-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to