Wildcards and phrases and 'spanish order' of the results

Author Message

Carlos Revillo

Tuesday 07 July 2009 6:20:54 am

Hi. I have two questions. Maybe they're not related to eZFind but Solr itself, but maybe some of you has similar issues.

First One. I would like to know if it's possible find a way to search for Articles that starts with a letter. I'll try to explain.

Supponse you have two articles. One is entitled 'Once upon a time' and the other one is 'in and old country'.

Doing a search like

{def $search = fetch('ezfind', 'search', hash( 
							'query', '',
							'class_id', array( 78 ),
							'filter', 'article/title:o*'
))}

i get these two articles in the results but i only 'need to find' the first one. trying to enquote the search doesn't work. so, i need a way, if possible, to work with wildcards and entire phrases.

The second one is related to spanish tildes. Suppose you have a set of words like:

avión
ángel
casa

if i filter by 'a*' i get

avión
ángel

and that's ok. but i only need to orther those words i get

avión
casa
ángel

So, is there any way to tell solr that 'á' should be between 'a' and 'b' for the orders?

Thank you.

Max Keil

Tuesday 07 July 2009 4:07:56 pm

Hi Carlos,

first issue:
I tried to execute the search on our eZ Find index. I can confirm that "o*" in your filter returns the objects with the second word starting with "o", but only if this attribute were indexed as "text" in your ezfind.ini. It's the normal case for text-lines.
- You can bypass this by changing text-lines into "string" types, but another problem appears: after this you cannot search for parts of the string.
- You can also create your own ezfSolrDocumentFieldBase class which would handles the indexing of text-lines - here you would store the name in two different ways:
-- first: as a string
-- second as a text
so both versions would be indexed in solr and you have to decide which of the types you take.

second issue:
solr is sorting in "natural order", so the extended ascii chars are located at the end. I found an interessting article about a similar problem:
http://wiki.epc.ub.uu.se/display/~ronnie/International+Sorting

Mit freundlichen Grüßen
Best regards

Max Keil

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

Carlos Revillo

Wednesday 08 July 2009 1:37:09 am

Hi Max.

Your reply has helped me a lot. I only need this condition (look in the entire field) for a few specific attributes. At first, those attributes was defined as ezstring.

So, what i've done is to build a custom datatype (just a copy of de default ezstring with some changes in the names) and map this datatype to string in my ezfind.ini.append.php.
Something like

[SolrFieldMapSettings]
DatatypeMap[ezcustomtext]=string

Then, I just added new attributes of this type to the classes, and with a cli script, i copied the values from the old attributes to the new ones and finally deleted the old ones. After running indexing script all is working as i want for those fields, so thank you very much!

For the second issue i will look at your recomendations. Thanks again.

Max Keil

Wednesday 08 July 2009 3:23:06 pm

Hi,

nice to read it. You're welcome!

Mit freundlichen Grüßen
Best regards

Max Keil

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

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 30 2025 21:10:16
Script start
Timing: Jan 30 2025 21:10:16
Module start 'layout'
Timing: Jan 30 2025 21:10:16
Module start 'content'
Timing: Jan 30 2025 21:10:16
Module end 'content'
Timing: Jan 30 2025 21:10:16
Script end

Main resources:

Total runtime0.0385 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 588.4063151.2422
Module start 'layout' 0.00750.0068 739.6484220.7500
Module start 'content' 0.01430.0227 960.39841,003.0703
Module end 'content' 0.03700.0014 1,963.468837.9922
Script end 0.0384  2,001.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00287.3041140.0002
Check MTime0.00112.8535140.0001
Mysql Total
Database connection0.00092.451610.0009
Mysqli_queries0.007018.116230.0023
Looping result0.00000.041510.0000
Template Total0.00102.610.0010
Template load0.00082.080710.0008
Template processing0.00020.522010.0002
Override
Cache load0.00051.384610.0005
General
dbfile0.006215.974980.0008
String conversion0.00000.027940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs