search engine, how to fetch data

Author Message

Mieczyslaw Morzonek

Thursday 08 July 2004 5:31:40 am

<form action={concat("/",$node.url_alias)|ezurl} method="post">

<select name="age" id="age">
    				<option value="">-- select --</option>
    				<option value="18">18 - 21</option>
    				<option value="22">22 - 26</option>
    				<option value="27">27 - 30</option>
  				</select>
                <select name="sex" id="sex">
  					<option value="">-- select --</option> 
    				<option value="male">male</option>
    				<option value="female">female</option>
				</select>
<select name="language" id="language">
  					<option value="">-- select --</option> 
    				<option value="Beginner">Beginner</option>
    				<option value="Intermediate">Intermediate</option>
    				<option value="Upper - Intermediate">Upper - Intermediate</option>
    				<option value="Advanced">Advanced</option>
  				</select>

<input class="searchbutton" name="SearchButton" type="submit" value="Search" />
</form>

I ve got class (id 16) with attributes age( id 191) sex(id 192) language(id 193). How to write search operator who will filtered data with this attributes?

Table is like this

<table width="60%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Age</td>
<td>Sex</td>
<td>Langiage</a></td>
</tr>
<tr>
<td>{attribute_view_gui attribute=$:item.object.data_map.age}</td>
<td>{attribute_view_gui attribute=$:item.object.data_map.sex}</td>
<td>{attribute_view_gui attribute=$:item.object.data_map.language}</td>
</tr>
</table>

This is my example

{let search=fetch( content , search ,
       hash( text, ezhttp('sex', 'post'), class_id, 16, class_attribute_id, 191) ) )}

{section loop=$search['SearchResult']}

{$:item.name}

{/section}

{/let}

It`s works fine but only for sex. I don`t know how to add age and language to this search syntax? How to fetch personw with sex=male age between 18 and 21 and language=intermediate?

Alex Jones

Thursday 08 July 2004 7:17:19 am

Perhaps the comments at the bottom of this bug report will help: http://ez.no/community/bug_reports/search_lacks_multi_attribute_queries

Alex
bald_technologist on the IRC channel: #eZpublish
http://www.agrussell.com :: http://www.cuttingedge.com

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Mieczyslaw Morzonek

Thursday 08 July 2004 7:28:33 am

Alex it`s so complicated for me. Could u write me an examle? This is a bug? So i can`t fetch data like this "sex=nale and age between 18 and 21 and language=intermediate"? Is possible to implement this simple SQL query to ez publish templates? I need to know that is possible to do?

I will be greatful for any help.

Mieczyslaw Morzonek

Monday 12 July 2004 2:55:22 am

I realy need to know. Please help me...

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.