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.

eZ debug

Timing: Jan 19 2025 01:06:26
Script start
Timing: Jan 19 2025 01:06:26
Module start 'layout'
Timing: Jan 19 2025 01:06:26
Module start 'content'
Timing: Jan 19 2025 01:06:27
Module end 'content'
Timing: Jan 19 2025 01:06:27
Script end

Main resources:

Total runtime1.5834 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 590.2656152.6250
Module start 'layout' 0.00520.0028 742.890639.4453
Module start 'content' 0.00801.5738 782.3359549.8984
Module end 'content' 1.58180.0016 1,332.234412.1563
Script end 1.5834  1,344.3906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2086160.0002
Check MTime0.00130.0839160.0001
Mysql Total
Database connection0.00060.040010.0006
Mysqli_queries1.532996.8082600.0255
Looping result0.00070.0461580.0000
Template Total1.545097.620.7725
Template load0.00200.128320.0010
Template processing1.543097.446920.7715
Template load and register function0.00020.014710.0002
states
state_id_array0.00410.261210.0041
state_identifier_array0.00220.139120.0011
Override
Cache load0.00170.1093320.0001
Sytem overhead
Fetch class attribute can translate value0.00070.046320.0004
Fetch class attribute name0.00180.114950.0004
XML
Image XML parsing0.00080.049920.0004
class_abstraction
Instantiating content class attribute0.00000.000750.0000
General
dbfile0.00070.0464160.0000
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0003 secs