Forums / Extensions / eZ Find / eZ Find 2.0 - Sort_by( )

eZ Find 2.0 - Sort_by( )

Author Message

cristine barbot

Wednesday 27 May 2009 3:04:42 am

Salut ,

j 'ai arrivé d'installer et utiliser eZ Find 2.0 ,le seul soucis que j'ai ,c'est de tri(Sort_by),
le tri s'effectuer sur les noeds et ne prend pas en considération ce qu' il est défini dans la fonction de recherche .

$tri = nom or ville or code_postal ...

{set $search=fetch( ezfind,search,
hash( 'query', cond(and(ezhttp_hasvariable('SearchText'), ne(ezhttp('SearchText'), '')), concat('"',ezhttp('SearchText','post'),'"'), '[* TO *]'),
'offset', $offset,
'limit', $page_limit,
'sort_by', hash(concat('attr_',$tri,'_t'),asc),
'filter', $filter,
'facet', $facetArray,
'class_id', $class_identifier ))}

quelqu'un a déjà avoir ce type problème (sort_by)

Merci,

Hans von Goering

Thursday 02 July 2009 12:29:19 am

you french people!
Cant you just write in English!

Thanks
HvG

Jean-Luc Nguyen

Friday 03 July 2009 2:47:02 am

Yes, you freaky french people!

http://www.acidre.com

Max Keil

Wednesday 15 July 2009 6:13:43 pm

Hi Cristine,

do you try to sort by an class-attribute-identifer?

'sort_by', hash(concat('attr_',$tri,'_t'),asc),

the strings "attr_" and "_t" will automatically be added by ezfind because of the getFieldName function. You should prepend the class_identifier:

'sort_by', hash( concat( $class_identifier, '/', $attribute_identifier ), asc )

example:

'sort_by', hash( 'product/name', asc )

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Vincent Tabary

Tuesday 25 August 2009 6:03:36 am

Hi,

I think I have the same problem. With Google, I do not really find something.

But in the tracker for eZFind, this ticket : http://issues.ez.no/IssueView.php?Id=15164 seams to match with our problem.

Unfortunately, it is not resolved...

Maybe there is a solution like to remove or to replace specials characters before indexing (to replace ä with a, "-" with " ", ...)

Vinz
http://vincent.tabary.me

Vincent Tabary

Wednesday 26 August 2009 7:26:22 am

Hi all,

I think I have a solution. Well, it worked for me.

In the ezfind extension, there is a lack in the setting file "settings/ezfind.ini".

Here is the modified category of my file :

[SolrFieldMapSettings]
# List of custom datatype mapping. eZ Publish datatype string is used
# as key, and the value if the name of the class to use.
#
# Example:
# CustomMap[eztext]=ezfSolrDocumentFieldText
CustomMap[ezobjectrelation]=ezfSolrDocumentFieldObjectRelation
CustomMap[ezobjectrelationlist]=ezfSolrDocumentFieldObjectRelation
CustomMap[ezxmltext]=ezfSolrDocumentFieldXML
CustomMap[ezmatrix]=ezfSolrDocumentFieldXML

# Datatype to field type map.
#
# Example:
DatatypeMap[ezstring]=string
DatatypeMap[eztext]=text
DatatypeMap[ezboolean]=boolean
DatatypeMap[ezdate]=date
DatatypeMap[ezdatetime]=date
DatatypeMap[ezfloat]=sfloat
DatatypeMap[ezinteger]=sint
DatatypeMap[ezprice]=sfloat
DatatypeMap[eztime]=date

# Default field type
Default=text

The only difference with the initial file is the line :

DatatypeMap[ezstring]=string

I'll try to add this to the ticket :)

Vinz
http://vincent.tabary.me