This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Extensions » eZ Find » How to exclude a term in search ?
expandshrink

How to exclude a term in search ?

How to exclude a term in search ?

Thursday 26 November 2009 11:45:35 am

I'm trying to use ezfind, but I have a problem in my query.

In doc (http://ez.no/doc/extensions/ez_fi...ion/template_fetch_functions#Filter), I can see :

Example:

 fetch( ezfind, search,
hash( query, 'eZ Systems',
filter, array( 'or',
array( 'and',
'article/body:hello',
'article/rating:[1 TO 10]' ),
array( 'and',
'article/body:goodbye',
'article/rating:[10 TO 20]' )))

 
Returns all articles containing the words “ez” and “systems”, either having both 'hello' present in the body and a rating comprised between 1 and 10, or having both 'goodbye' in the body and a rating comprised between 10 and 20.

Now, how can I do if I want articles WITHOUT "goodbye" in the body ?

In solr doc (http://wiki.apache.org/solr/SolrQ...ifferences_From_Lucene_Query_Parser), it says I should use a "-".

But it doesn't work (ezfind error) :

 ...
array( 'and',
'-article/body:goodbye',
'article/rating:[10 TO 20]' )))

The error I get :

 Got invalid result from search engine.<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 400 </title>
</head>
<body><h2>HTTP ERROR: 400</h2><pre>org.apache.lucene.queryParser.ParseException: Cannot parse '( meta_contentclass_id_si:36 AND attr_myattribute_t:myvalue )
.....
 
 Encountered " ":" ": "" at line 1, column 0.

 Any idea ?

Modified on Thursday 26 November 2009 1:04:22 pm by Nicolas Lescure

No reply yet!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from