RE: jahia search field

[email protected]
Newsgroups gmane.comp.cms.jahia.template
Message-ID <OFB3F469C6.4634EE7D-ONC12570C2.0054FC1F-C12570C2.0056DC45@commaro.com>
Have you already tried in a similar manner like you have done it for the 
filename?
Like, for example

String doSearchOnDirectoryProjectName = 
JahiaTools.getStrParameter(request,"doSearchOnDirectoryProjectName","");
if( !"".equals(doSearchOnDirectoryProjectName)){
 if ( advOptions.length()>0 ) {
  advOptions.append(" AND ");
 }
 advOptions.append("(" + 
JahiaSearchConstant.FIELD_FIELDNAME+":directoryProjectName)");
}
else {
String doSearchOnDirectoryProjectDescription = 
JahiaTools.getStrParameter(request,"doSearchOnDirectoryProjectDescription","");
if( !"".equals(doSearchOnDirectoryProjectDescription)){
 if ( advOptions.length()>0 ) {
  advOptions.append(" AND ");
 }
  advOptions.append("(" + 
JahiaSearchConstant.FIELD_FIELDNAME+":directoryProjectDescription)");
}
}

Be aware also, that you can not perform a search on two fields combined 
with AND clause simultaneously, i.e. search with options 
'fieldname:directoryProjectName AND fieldname:directoryProjectDescription' 
will bring no results.

I'm not sure if this helps

Kind reagards.




"BARREAU Amandine" <[email protected]> 
23.11.2005 15:39
Please respond to
<[email protected]>


To
<[email protected]>
cc

Subject
RE: jahia search field






I want to customize advanced search by adding other input. I have already 
add input search on filename by adding:
 
filename = JahiaTools.getStrParameter(request,"filename","");
  if( !"".equals(filename)){
   if ( advOptions.length()>0 ){
    advOptions.append(" AND (");
   } else {
    advOptions.append("(");
   }
   advOptions.append(JahiaSearchConstant.FILE_NAME+":");
   advOptions.append(filename);
   advOptions.append(")");
 
  }
 
I works fine 
and now I want to add input serach on some custom fields like 
'directoryProjectName' or 'directoryProjectDescription'.
 
Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.