Negative queries

Author Message

Carlos Revillo

Monday 31 August 2009 12:43:28 pm

Hi.

Acording to SolrQuerySintax page [1], it's possible to do 'negative queries', so you can fetch something that is not 0 for example.

Is this possible with eZFind? i would like to fetch all the contents of a class filtering by an attribute wich value is not 0.

is really easy to fetch all that are 0, but i don't know how to fetch those wich are not 0.

my code looks like

{def $results = fetch('ezfind', 'search', hash(
                                 'query', $query,
                                 'filter', array('myclass/myattr:0')
))}

how can i change this to fetch those wich myattr value is not 0?

Thanks in advance.

[1] http://wiki.apache.org/solr/SolrQuerySyntax

Carlos Revillo

Tuesday 01 September 2009 5:24:26 am

Actually, if i use

{def $results = fetch('ezfind', 'search', hash(
                                'query', $query,
                                'filter', array('myclass/myattr:[1 TO *])
))}

i get what i want... but still interested on negative queries :).

Bruce Morrison

Monday 05 October 2009 1:39:05 am

Check out this http://www.stuffandcontent.com/2009/10/adding-negative-filters-to-ez-find.html

Enhancement request & patch http://issues.ez.no/IssueView.php?Id=15617&activeItem=1

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

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 18 2025 10:27:37
Script start
Timing: Jan 18 2025 10:27:37
Module start 'layout'
Timing: Jan 18 2025 10:27:37
Module start 'content'
Timing: Jan 18 2025 10:27:37
Module end 'content'
Timing: Jan 18 2025 10:27:37
Script end

Main resources:

Total runtime0.4758 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 589.0703152.6250
Module start 'layout' 0.00500.0038 741.695339.4453
Module start 'content' 0.00880.4655 781.1406534.3516
Module end 'content' 0.47440.0014 1,315.492212.1641
Script end 0.4758  1,327.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.6962160.0002
Check MTime0.00150.3152160.0001
Mysql Total
Database connection0.00070.148810.0007
Mysqli_queries0.431290.6228590.0073
Looping result0.00050.1074570.0000
Template Total0.443493.220.2217
Template load0.00210.446620.0011
Template processing0.441392.744020.2206
Template load and register function0.00020.033410.0002
states
state_id_array0.00130.262910.0013
state_identifier_array0.00120.246320.0006
Override
Cache load0.00180.3754200.0001
Sytem overhead
Fetch class attribute can translate value0.00070.149620.0004
Fetch class attribute name0.00130.268640.0003
XML
Image XML parsing0.00100.211520.0005
class_abstraction
Instantiating content class attribute0.00000.002140.0000
General
dbfile0.00100.2086160.0001
String conversion0.00000.001940.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs