Forums / Extensions / eZ Find / Wildcards and phrases and 'spanish order' of the results

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

eZ debug

Timing: Jan 18 2025 02:49:08
Script start
Timing: Jan 18 2025 02:49:08
Module start 'content'
Timing: Jan 18 2025 02:49:08
Module end 'content'
Timing: Jan 18 2025 02:49:09
Script end

Main resources:

Total runtime0.5776 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9844180.7578
Module start 'content' 0.00540.4675 768.7422566.6719
Module end 'content' 0.47290.1046 1,335.4141336.7344
Script end 0.5775  1,672.1484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.6463210.0002
Check MTime0.00140.2476210.0001
Mysql Total
Database connection0.00050.093310.0005
Mysqli_queries0.510688.40441990.0026
Looping result0.00180.30891970.0000
Template Total0.548394.920.2741
Template load0.00190.326520.0009
Template processing0.546494.593320.2732
Template load and register function0.00010.023510.0001
states
state_id_array0.00090.160910.0009
state_identifier_array0.00100.174820.0005
Override
Cache load0.00150.2525420.0000
Sytem overhead
Fetch class attribute can translate value0.00100.166630.0003
Fetch class attribute name0.00120.211850.0002
XML
Image XML parsing0.00090.148930.0003
class_abstraction
Instantiating content class attribute0.00000.002860.0000
General
dbfile0.00150.2608270.0001
String conversion0.00000.001130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs